See dotnet/corefx#40792 (comment) for more context.
Currently, we have certain constants that we use to detect the token size against before starting to write the token.
https://github.com/dotnet/corefx/blob/70b4d01e18236c925c2d44d49fff7cbb4919dc43/src/System.Text.Json/src/System/Text/Json/JsonConstants.cs#L64-L67
These may not be necessary if we used checked arithmetic for figuring out the maximum size of the buffer needed for the output.
cc @stephentoub