CLN: Use is_period_dtype instead of ABCPeriodIndex checks
Will be more generally correct for catching both PeriodIndex and PeriodArray.

Unrelated change of `l` -> `length`
Hello @jbrockmendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/period.py`](https://github.com/jbrockmendel/pandas/blob/ce45ff75481534b900bb521c342152c333224206/pandas/core/arrays/period.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/datetimelike.py`](https://github.com/jbrockmendel/pandas/blob/ce45ff75481534b900bb521c342152c333224206/pandas/core/indexes/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/multi.py`](https://github.com/jbrockmendel/pandas/blob/ce45ff75481534b900bb521c342152c333224206/pandas/core/indexes/multi.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/range.py`](https://github.com/jbrockmendel/pandas/blob/ce45ff75481534b900bb521c342152c333224206/pandas/core/indexes/range.py) !

 Thanks!