Let _get_dtype accept Categoricals and CategoricalIndex 
 - [ x] closes #16817
 - [x ] tests added / passed
 - [x ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.)
 - [ ] whatsnew entry

Makes ``_get_dtype`` accept ``Categorical``s and ``CategoricalIndex``. Also passes relevant tests in ``test_common.py``.

See also discussion in #16845. Is there a manual for checking performance (can't imagine this affects performance, though)?