Add _expand_user to _stringify_path as we need to allow tilde - ~, to expand to full path

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