Remove remaining StringBuilder marshaling use from Corelib (dotnet/coreclr#21120)
* Remove remaining StringBuilder marshaling use from Corelib
- Unix globalization functions were using StringBuilder. Replaced them with stackallocs, as the max sizes were all relatively small.
- Registry methods were declared to use StringBuilder, but these weren't actually used by corelib, and in fact, corefx isn't using StringBuilder with them either. I've changed the definitions for now to use char[] instead (all the call sites are passing in null), and I'll fix up some corefx usage separately.
- Resource-related functions were using StringBuilder, and have been replaced with stackallocs, given reasonably small max buffer sizes.
- ExpandEnvironmentVariables was using a StringBuilder, but it's rewritten equivalent code in corefx is not. For now I've copied the corefx function over to coreclr to replace the different implementation, but we can look at subsequently consolidating them into one.
* Address PR feedback
Commit migrated from https://github.com/dotnet/coreclr/commit/
a9b57bd4fe194b30b3c6e9a85a316fc218f474be