refactor: Replace const char* to std::string
Summary:
Some functions should be returning std::string instead of const char*. This commit changes that.
Backport of core PR19004.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D9124