CLN: miscellaneous cleanups / fixes
#21365 made good progress on #21336 so I copied the test from there and referenced it in the whatsnew.

closes #19700
closes #19011
closes #21336
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
