PERF: 30% faster is_period_object checks
Doing an appropriate isinstance check occurs all in C-space.

```
In [1]: import pandas as pd                                                                                                                                                   
In [2]: from pandas._libs.lib import *                                                                                                                                        
In [3]: obj = pd.Period(2004, "A")                                                                                                                                            

In [4]: %timeit is_scalar(obj)                                                                                                                                                
78.4 ns ± 0.761 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- PR
101 ns ± 1.74 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- master

In [5]: %timeit is_period(obj)                                                                                                                                                
54.1 ns ± 0.548 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- PR
80.7 ns ± 1.14 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- master

In [6]: %timeit is_period([])                                                                                                                                                 
50.1 ns ± 1.02 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- PR
340 ns ± 26.9 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  # <-- master

In [7]: %timeit is_scalar([])                                                                                                                                                 
65.6 ns ± 0.421 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- PR
67.1 ns ± 0.293 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)  # <-- master

In [8]: obj2 = object()                                                                                                                                                       

In [9]: %timeit is_scalar(obj2)                                                                                                                                               
544 ns ± 6.97 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  # <-- PR
782 ns ± 6.3 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)  # <-- master

```