Make use of std::string_view and std::optional in the util/{strencodings, string} files.
This avoids many temporary string/vector objects being created, while making the interface easier to read. Changes include:
- Make all input arguments in functions in util/strencodings and util/string take std::string_viewinstead ofstd::string.
- Add RemovePrefixViewandTrimStringViewwhich also returnstd::string_viewobjects (the correspondingRemovePrefixandTrimStringkeep returning anstd::string, as that’s needed in many call sites still).
- Stop returning std::stringfromDecodeBase32andDecodeBase64, but return vectors. Base32/64 are fundamentally algorithms for encoding bytes as strings; returningstd::stringfrom those (especially doing it conditionally based on the input arguments/types) is just bizarre.
- Stop taking a bool* pf_invalidoutput argument pointer inDecodeBase32andDecodeBase64; return anstd::optionalinstead.
- Make DecodeBase32andDecodeBase64more efficient by doing the conversion from characters to integer symbols on-the-fly rather than through a temporary vector.