Use locale independent ToString(…) instead of locale dependent strprintf(…) for low-level string formatting.
Context: See sipas comment in #18147 (comment).
Example taken from #18281:
Low level functions
ScriptToAsmStr(core_io),i64tostr(strencodings) anditostr(strencodings) are locale dependent:const std::vector<uint8_t> b{0x6a, 0x4, 0xff, 0xff, 0xff, 0xff}; const CScript script{b.begin(), b.end()}; for (const std::string& locale_string : {"C", "de_DE"}) { std::locale::global(std::locale(locale_string)); std::cout << "[" << locale_string << "] ScriptToAsmStr(script, false) == " << ScriptToAsmStr(script, false) << "\n"; }[C] ScriptToAsmStr(script, false) == OP_RETURN -2147483647 [de_DE] ScriptToAsmStr(script, false) == OP_RETURN -2.147.483.647
Fixes #18281.