BUG: lzma is a required part of python, make it optional
Importing `lzma` when Python has been compiled without its support (usually due to a lack of `xz` in the system) will raise a warning. Substituted `import lzma` for helper function.

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