BUG: fix to_latex() when using MultiIndex with NaN in (#14249) (v2)
This is an improved version of #19910 cleaning up MultiIndex handling in the process.

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

~~I quickly looked at some other issues that this didn't originally aim to address and found that this PR closes #19981 and #18326 too, but I didn't add a tests or whats new entries for those (yet).~~

Edit: tests and whatsnew entries added for:

- [x] closes #19981   
- [x] closes #18326
- [x] closes #18669 