ENH: Create directories when missing in to_* methods
This is the most fundamental approach to creating new folders when a user specifies a path that is missing in file creation methods like `to_csv`, `to_excel`, `to_feather` etc. We can do this in [io/common.py:`get_handle()`](https://github.com/pandas-dev/pandas/blob/50a59bac1f2bcbf9ac87c7a4160d4355be512294/pandas/io/common.py#L521) conditionally when the file buffer provided is in a writable mode.

- [x] closes #24306
   - Can use the existing #42250 to extend documentation for each of the `to_*` methods (@Joeperdefloep)
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

So do we want default behaviour to be that directories are always created or an extra argument like `mkdirs=True` that needs to be passed? I tried to do it that way, but passing the argument through gave a lot of changes, and I thought the conclusion from #24306 was to just add it to the documentation. However, I think the change in behaviour is most welcome 🎉 

I can add that to the documentation. Then that would be in all `to_something` that can be a file? Exposing an argument to control this might be helpful and shouldn't be too much work (and would allow us to reinstate the two tests I removed). I'll defer to the maintainers as to whether this should be on or off by default, but I agree that changing these to create missing directories by default is much more intuitive for novice users. Then I'll also wait with the documentation until this is resolved :) This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. Thanks for the PR, but as mentioned, the team isn't keen on supporting an API that creates directories and instead would prefer a documentation approach like in https://github.com/pandas-dev/pandas/pull/42250/files. Closing.