COMPAT: avoid calling getsizeof() on PyPy
closes #17228 

WIP Relates to issue #17228, this is a simple possible solution to the issue. Not sure this approach is the best, perhaps ``deep=True`` should raise on PyPy?
