Implement maybe_cache for compat between immutable/mutable classes
Also fixes lookups/docstrings for class-level access to cache_readonly attributes.

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

Related: https://github.com/pandas-dev/pandas2/issues/27