This ensures that string (which was previously kept on the stack) is
still alive during finalization.
Str is an argument, so guaranteed (on a single thread) to exist through the execution of this function, no?
Or is this about the report_fatal_error at the end, which could print garbage?
Ready to land as D29441.