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
this seems like quite a lot of extra code when you could simply override hasnans for Series > this seems like quite a lot of extra code when you could simply override hasnans for Series

If it were just `hasnans` I would agree.  The motivation comes from WIP to move arith/comparison ops from DatetimeIndexOpsMixin/DTI/TDI/PI to array classes, where there are currently a bunch of cache_readonlys that need to be flipped.  This seemed like a reasonable scope to break off of what would otherwise be a giant diff (similar train of thought for #19672). Since this is failing tests anyway, I'll remove the new pieces and just fix hasnans and the docstrings. No idea what’s up with this test. Closing to narrow the queue