var/out variables are much safer, since the variable exists at the calling site , is valid and not null.
It is also much safer than C++'s & references. It is very subtle, but rather amazing if you think about it. Because C++ can return a & reference, it can return a reference to a value on the stack frame of the callee, which then becomes invalid. But the var/out variable always exists on caller's site, so it is always safe.
(at least if it a reference to the stack. a reference to the heap could be freed indirectly through another reference. )
Is returning references frequently done in C++? I have only seen it in ostream's << operator-like constructs where you want to chain multiple calls to the same object.
Another source of issues might be the creation of temporaries.
Yes, in index operator as well.
It is rather common to avoid copying returned objects. (perhaps it becomes less common with std::move ?)
For example, the [] operator on the standard collections returns a reference, so the item can be modified
There Pascal has another clever idea. You can overload [] for reading and writing separately. Then x[k] := v becomes x.setItem(k, v)
[Edit] For example, you can also insert into a string, making it longer, without having to worry about it.
Then the pointed-at pointer can be manipulated within the method body and changes will be visible on the outside as well, giving you both the numeric return value as well as the shortened string as the output. This is what the second argument of the strto{d,f,ld} function does: https://devdocs.io/c/string/byte/strtof