[flang] Add `std::string ExpressionBase::AsFortran()`
This is easier to use when including an expression in an error message
and also useful when debugging for dumping expressions.
Fix up several places that no longer need to use a temporary
std::stringstream.
Also change some references to `operator<<` in `formatting.cc` and
`symbol.cc` that became ambiguous with this change.
Original-commit: flang-compiler/f18@
25dc49b6e9cf5bce61d6d655ab242609cbd28e13
Reviewed-on: https://github.com/flang-compiler/f18/pull/944
Tree-same-pre-rewrite: false