use a try block in _expand_user instead of a typing condition
Noticed that `_expand_user`'s docstrings stated that expansion was performed "if possible", while the actual implementation was only applying expansion to str objects.
With a try block it should work with str, os.Pathlike and bytes objects (and everything else supported by `os.path.expanduser` in the future).
I except this change may be undesirable since it will force the output type to `str`. In this case I can replace this with a docstring update.
I'll complete the checklist with tests and whatsnew entry if the change is deemed desirable.

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