Using os.PathLike instead of pathlib.Path (#37979)
- [x] closes #37979 
- [x] tests passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Replaces `pathlib.Path` with `os.PathLike` to bring behaviour further in-line with the [documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html)
@Abhi-H see if you can make mypy happy. Working on fixing the mypy errors. @arw2019 Is there still a merge error? I don't quite understand what those are, so a link or guidance on how I could resolve it would be very helpful. I am assuming that this is related to the git side of things as the code seems to pass all checks, so I can quickly resolve it!
Also, just checked and the changes I was making are there.  With some git-magic and help from a friend, I think I fixed the merge conflict. Let me know if this is fine! I am a little stuck here. The tests that are failing in these builds are not failing when I run them locally. What could be causing this? I think the only test that is failing in this PR but not on master is `test_to_csv_compression_encoding_gcs`. Can you run that test locally to see whether it works for you `pytest -k test_to_csv_compression_encoding_gcs pandas/tests/io/test_gcs.py`. I will test it later today on my machine on linux.

edit: I don't get the above error. The removed `hasattr(...)` shouldn't have an impact as the testcase uses already a string. Maybe just rebase and hope for the best: `git pull --rebase upstream master` Thanks for checking it out, I tried and didn't get the error either when running locally either. Have rebased and pushed a second time. thanks @Abhi-H very nice!