Improve performance of integer formatting (#76726)