Replace _has_complex_internals #29227
closes #29227

Hi, it my first issues within hacktoberfest. 
I replaced _has_complex_internals with isinstance/
Is it possible to import ABCMultiIndex?

You're going to need to run `isort -rc pandas` to fix the linting errors.  In the reduction.pyx we don't allow imports from `core`, so the check will need to be something like `index.nlevels > 1` also pls merge master, we just update the codebase with another small usage of  this (which needs to be changed) pushed rebased and isort fixup @jbrockmendel this needed or did you already remove? still needed ok @Aivengoe can you merge master. 

@jbrockmendel feel free to push here if its faster thanks @Aivengoe and @jbrockmendel 