CLN: replace str.format() in pandas/io/formats
- [x] ref #29547 and ref #30020 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Merging master should fix the CI issues.