PERF: perf improvments in dtypes/ftypes methods (GH5968)

closes #5968

```
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
frame_dtypes                                 |   0.2654 |  51.2140 |   0.0052 |
frame_wide_repr                              |  17.1947 | 525.7313 |   0.0327 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------

Ratio < 1.0 means the target commit is faster then the baseline.
Seed used: 1234

Target [6a7bfc1] : PERF: perf improvments in dtypes/ftypes methods (GH5968)
Base   [2081fcc] : Merge pull request #5951 from y-p/PR_latest_ipython_rep_fixes

CLN: repr_html raises NotImplementedError rather then ValueError in qtconsole
```