TYP: fix mypy ignored err in pandas/io/formats/format.py
- [ ] xref #37715
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Handle ignored mypy error in ``pandas/io/formats/format.py``