Improve Enum.ToString perf for [Flags] enums (dotnet/coreclr#21254)
Two main changes:
- Rather than using a StringBuilder to insert the strings for all of the consistuent values, we track the constituent values in a span, summing the expected length, and then new up a string and copy the results directly into it.
- When there's a single value that matches the supplied value, we just return the cached string rather than allocating a new one.
Commit migrated from https://github.com/dotnet/coreclr/commit/
effe7cafdb828fc90ec7bbd09ae8b3c259a76eb0