Issue #6713: Improve performance of str(n) and repr(n) for integers n