fix length_of_indexer to handle boolean array indexer.
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

To fix the issue #25774 .
Please make sure to add tests for any PR. Should also run locally to make sure no issues before pushing to GH I'm not willing to have my PR accepted. I just wanted to show a workaround to fix the bug.