Issue #15989: Fix possible integer overflow in str formatting as in unicode formatting.