Message 85909 - Python tracker
The patch I submitted adds a special-case for inf/-inf/NaN so that sprintf is avoided for those values. Should work on any platform, I believe. I'm not sure how it interacts with your 3.x plans. Seems like it would be a good patch for 2.7 at least, though. (and the patch that adds tests should go into both 2.7 and 3.x)