Returning a copy of a string will essentially do something like this:
string s = foo();
will, when the compiler generates machine code, appear similar to:
string s;
foo(&s);
Naturally, if you change the type of the return type, the pointer to s
needs to be appropriately modified. So no, you can't change the return type and maintain binary compatibility (and it will almost certainly not even compile, as the signature of the function has changed -> differnet mangled name -> "undefined reference").