Not all the workarounds necessary to fully emulate dotnet/runtime#86056 (the fix) are in place here, both because some code changes cannot be replicated in our own code due to accessing internal APIs, and because some of them seem less likely to be used so I didn't bother.
This works around https://github.com/dotnet/runtime/issues/85981 so we can move forward with System.Text.Json migration.
Not all the workarounds necessary to fully emulate dotnet/runtime#86056 (the fix) are in place here, both because some code changes cannot be replicated in our own code due to accessing internal APIs, and because some of them seem less likely to be used so I didn't bother.
CC: @eiriktsarpalis