Upgrade `os.path` to use `pathlib.Path` API for `from_pretrained` internals
# 🚀 Feature request

Use `pathlib.Path` instead of `os.path` in places like `src/transformers/file_utils.py` and `src/transformers/configuration_utils.py`

## Motivation

I am using [cloudpathlib](https://github.com/drivendataorg/cloudpathlib), a library that wraps remote path as `pathlib.Path` like object. But I cannot use a cloudpathlib's remote directory for `from_pretrained` because the existing code uses `os.path`. Using `pathlib`'s API would solve this.

## Your contribution

I can submit a PR for this. I see pathlib used elsewhere inside `src/transformers`, so I think it's ok.
This requires more code than I anticipated, and the caching isn't as fast as local. I think I will just download to local and call `from_pretrained` with local path.<|||||>Thanks for exploring

> I think I will just download to local and call from_pretrained with local path.

Yes it's the way we've been recommending 👍 