Rationale: Addresses #19000
Some functions should be returning std::string instead of const char*.
This commit changes that.
Main benefits/reasoning:
- The functions never return nullptr, so returning a string makes code at call sites easier to review (reviewers don’t have to read the source code to verify that a nullptr is never returned)
- All call sites convert to string anyway