Repository: Qiskit/qiskit

Issue:
Performance regression in circuit construction because of type checking
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: Master
- **Python version**: Any
- **Operating system**: Any

### What is the current behavior?

Since #4591 merged there has been a significant performance regression in circuit construction time. The addition of an `isinstance` check on `numbers.Integral` adds significant overhead. This is likely because `ABCmeta` (which is what `numbers.Integral` is built on) defines a custom isinstance checker to enable external registration. 

For example: https://qiskit.github.io/qiskit/#converters.ConverterBenchmarks.time_circuit_to_instruction?machine=qiskit-benchmarking&os=Ubuntu%2018.04&ram=16%20GB&p-n_qubits=5&p-depth=8192&commits=ec5e5370

I reverted the commit locally to test the performance difference and it made a sizeable improvement:

```
Benchmarks that have improved:

       before           after         ratio
     [4f30d98f]       [4e03197b]
     <master>         <no-more-numbers>
-         126±1μs          113±9μs     0.89  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 8)
-      37.2±0.2ms         33.0±1ms     0.89  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 8192)
-         457±5ms          397±4ms     0.87  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 32768)
-      4.55±0.08s       3.95±0.02s     0.87  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 8)
-      28.1±0.3ms       24.3±0.4ms     0.87  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 2048)
-     1.76±0.01ms      1.53±0.02ms     0.87  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 128)
-     2.37±0.01ms      1.98±0.02ms     0.83  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 128)
-       113±0.5ms         94.2±3ms     0.83  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 8192)
-         2.45±0s          2.03±0s     0.83  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 131072)
-         616±2ms          508±6ms     0.82  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 32768)
-       184±0.3μs          152±7μs     0.82  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 8)
-       151±0.2ms          120±4ms     0.80  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 8192)
-         1.83±0s       1.43±0.07s     0.78  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 131072)
-      37.3±0.2ms         28.8±2ms     0.77  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 2048)
-        538±30ms         414±20ms     0.77  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 2048)
-       216±0.5μs          166±8μs     0.77  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 8)
-         712±5ms          530±2ms     0.74  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 32768)
-      43.2±0.2ms       31.8±0.2ms     0.74  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 2048)
-     2.91±0.01ms      2.13±0.05ms     0.73  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 128)
-       2.28±0.1s       1.66±0.08s     0.73  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 8192)
-         176±2ms          127±2ms     0.72  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 8192)
-     2.44±0.08ms       1.76±0.1ms     0.72  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 8)
-      2.85±0.01s       2.01±0.05s     0.71  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 131072)
-       386±0.6μs          263±4μs     0.68  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 8)
-         493±2ms          328±7ms     0.67  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 8)
-      48.6±0.3ms       31.8±0.4ms     0.65  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 2048)
-     3.23±0.01ms      2.05±0.09ms     0.63  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 128)
-         3.17±0s       2.00±0.03s     0.63  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 131072)
-      1.49±0.01s         936±20ms     0.63  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 2048)
-         796±3ms          497±9ms     0.62  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 32768)
-      6.10±0.02s        3.79±0.2s     0.62  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 8192)
-        88.0±5ms         54.3±2ms     0.62  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 128)
-         198±1ms          121±1ms     0.61  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 8192)
-      1.46±0.02s         855±30ms     0.58  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 128)
-     6.98±0.04ms       3.89±0.1ms     0.56  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 8)
-      3.80±0.01s       2.10±0.06s     0.55  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 131072)
-        89.0±1ms         48.4±2ms     0.54  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 8)
-         335±1ms          182±5ms     0.54  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 128)
-         235±1ms          126±4ms     0.54  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 8192)
-        931±10ms          495±9ms     0.53  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 32768)
-        806±30μs         428±20μs     0.53  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 8)
-     3.87±0.09ms       2.03±0.1ms     0.52  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 128)
-        58.1±1ms         30.2±1ms     0.52  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 2048)
-     1.35±0.01ms         635±30μs     0.47  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 8)
-     5.28±0.04ms      2.45±0.03ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 128)
-      1.08±0.03s         500±20ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 32768)
-         274±3ms          126±4ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 8192)
-      4.42±0.02s       2.02±0.05s     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 131072)
-      68.6±0.3ms         31.2±1ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 2048)

Benchmarks that have stayed the same:

       before           after         ratio
     [4f30d98f]       [4e03197b]
     <master>         <no-more-numbers>
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 128)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 128)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 32768)
          104±8μs          116±4μs    ~1.12  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 8)
         478±20μs          523±1μs     1.10  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 128)
         567±40μs         602±30μs     1.06  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 128)
         571±50μs         601±50μs     1.05  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 128)
         32.3±2ms         33.9±1ms     1.05  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 8192)
         29.9±1ms       31.3±0.3ms     1.05  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 8192)
          161±7μs        167±0.8μs     1.04  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 8)
         31.0±2ms         32.1±2ms     1.03  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 8192)
         34.7±1μs       35.9±0.1μs     1.03  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 8)
       8.74±0.7ms       9.01±0.4ms     1.03  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 2048)
         120±10μs        124±0.5μs     1.03  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 8)
       7.34±0.2ms      7.53±0.08ms     1.03  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 2048)
         592±20ms         606±20ms     1.02  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 131072)
         34.0±1ms       34.9±0.5ms     1.02  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 8192)
        9.73±0.2s       9.93±0.09s     1.02  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 128)
       11.4±0.3ms      11.6±0.02ms     1.02  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 8)
       9.03±0.3ms       9.17±0.2ms     1.02  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 2048)
        11.0±0.2s        11.1±0.1s     1.01  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 32768)
       33.9±0.2ms       34.4±0.8ms     1.01  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 8192)
       43.0±0.8μs      43.5±0.08μs     1.01  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 8)
        10.2±0.1s       10.3±0.07s     1.01  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 8192)
       36.0±0.2μs      36.1±0.09μs     1.01  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 8)
          557±3μs        559±0.6μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 128)
          534±3ms          536±4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 131072)
          609±6ms          612±2ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 131072)
        9.86±0.1s       9.90±0.08s     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 8)
         466±20μs         467±10μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 128)
       14.6±0.07s       14.7±0.02s     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 131072)
      9.20±0.04ms       9.22±0.8ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 2048)
         643±30μs         644±40μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 128)
       8.21±0.4ms       8.21±0.4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 2048)
          133±2ms          133±1ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 32768)
       42.4±0.4μs         42.4±1μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 8)
       35.2±0.4ms       35.1±0.6ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 8192)
       71.4±0.6μs       71.3±0.4μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 8)
       12.1±0.8ms      12.1±0.01ms     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 128)
       37.2±0.3ms       37.1±0.4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 8192)
          150±2ms          150±2ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 32768)
          151±3ms          151±2ms     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 8)
          146±7ms          146±4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 32768)
         591±20ms          588±8ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 131072)
       36.9±0.2ms       36.7±0.4ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 8192)
         179±20μs         178±20μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 8)
          588±6ms         584±10ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 131072)
          226±2ms          224±3ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 2048)
       2.51±0.08s       2.49±0.03s     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 2048)
         909±20ms         900±40ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 8192)
      8.93±0.04ms       8.84±0.2ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 2048)
        515±0.6μs         509±20μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 128)
       43.0±0.2μs         42.5±4μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 8)
        154±0.2ms          153±3ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 128)
          149±1ms          147±2ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 32768)
       8.32±0.4ms       8.22±0.6ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 2048)
       3.61±0.03s       3.56±0.06s     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 32768)
         563±30μs          555±2μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 128)
       8.46±0.1ms       8.33±0.3ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 2048)
      2.95±0.01ms       2.91±0.1ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 8)
          703±2μs         693±50μs     0.98  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 128)
          607±3ms         597±10ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 131072)
          10.2±0s       10.0±0.06s     0.98  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 2048)
      8.48±0.03ms       8.33±0.2ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 2048)
          146±5ms          144±3ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 32768)
          2.50±0m       2.45±0.04m     0.98  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 8)
       2.50±0.02s       2.44±0.03s     0.98  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 8)
          599±3ms          584±1ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 131072)
          2.83±0s       2.76±0.03s     0.97  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 8192)
          148±1ms          143±6ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 32768)
       149±0.09ms          145±2ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 32768)
          141±3ms          136±2ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 32768)
       36.6±0.5ms         35.3±2ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 8192)
          523±4ms         504±10ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 131072)
          624±2ms          602±8ms     0.96  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 8)
          146±5ms         140±10ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 32768)
        152±0.6ms          147±4ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 32768)
       35.7±0.6ms         34.3±1ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 8192)
          620±1ms          595±2ms     0.96  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 128)
       2.49±0.02s       2.39±0.02s     0.96  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 128)
          589±9ms          564±5ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 131072)
          145±3ms          139±2ms     0.95  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 32768)
          132±1ms          126±1ms     0.95  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 32768)
          600±2ms          569±9ms     0.95  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 131072)
          705±3ms          668±3ms     0.95  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 2048)
          601±3μs         567±30μs     0.94  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 128)
          580±5ms         547±10ms     0.94  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 131072)
          595±6ms         559±20ms     0.94  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 131072)
        19.8±0.5s        18.6±0.6s     0.94  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 131072)
       8.95±0.5ms       8.36±0.6ms     0.93  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 2048)
       67.9±0.6μs         63.2±4μs     0.93  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 8)
        1.24±0.1s       1.13±0.07s     0.91  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 8192)
         561±20μs         508±40μs    ~0.90  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 128)
      34.8±0.08ms         31.5±1ms    ~0.90  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 8192)
         561±10μs         503±50μs    ~0.90  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 128)
         311±20ms         277±20ms    ~0.89  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 2048)
        5.20±0.1s        4.62±0.3s    ~0.89  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 32768)
      8.52±0.01ms       7.57±0.6ms    ~0.89  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 2048)
         44.0±2μs         38.8±2μs    ~0.88  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 8)
       20.7±0.8ms       17.7±0.9ms    ~0.85  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 128)
      8.16±0.06ms       6.91±0.4ms    ~0.85  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 2048)
        14.4±0.2s        11.4±0.2s    ~0.79  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 128)
        8.81±0.1s        6.71±0.2s    ~0.76  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 32768)
       5.82±0.03s       3.69±0.06s    ~0.63  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 2048)

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.
```



### Steps to reproduce the problem

Run circuit construction after #4591

### What is the expected behavior?

Circuit construction performs the same as before.

### Suggested solutions

Come up with a scheme for type checking that doesn't introduce so much overhead, like either changing the ordering or iexplicitly checking for numpy trpes instead of relying on `Numbers.integral` or if we can't come up with a performant alternative then we should revert #4591.

Performance regression in circuit construction because of type checking
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: Master
- **Python version**: Any
- **Operating system**: Any

### What is the current behavior?

Since #4591 merged there has been a significant performance regression in circuit construction time. The addition of an `isinstance` check on `numbers.Integral` adds significant overhead. This is likely because `ABCmeta` (which is what `numbers.Integral` is built on) defines a custom isinstance checker to enable external registration. 

For example: https://qiskit.github.io/qiskit/#converters.ConverterBenchmarks.time_circuit_to_instruction?machine=qiskit-benchmarking&os=Ubuntu%2018.04&ram=16%20GB&p-n_qubits=5&p-depth=8192&commits=ec5e5370

I reverted the commit locally to test the performance difference and it made a sizeable improvement:

```
Benchmarks that have improved:

       before           after         ratio
     [4f30d98f]       [4e03197b]
     <master>         <no-more-numbers>
-         126±1μs          113±9μs     0.89  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 8)
-      37.2±0.2ms         33.0±1ms     0.89  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 8192)
-         457±5ms          397±4ms     0.87  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 32768)
-      4.55±0.08s       3.95±0.02s     0.87  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 8)
-      28.1±0.3ms       24.3±0.4ms     0.87  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 2048)
-     1.76±0.01ms      1.53±0.02ms     0.87  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 128)
-     2.37±0.01ms      1.98±0.02ms     0.83  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 128)
-       113±0.5ms         94.2±3ms     0.83  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 8192)
-         2.45±0s          2.03±0s     0.83  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 131072)
-         616±2ms          508±6ms     0.82  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 32768)
-       184±0.3μs          152±7μs     0.82  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 8)
-       151±0.2ms          120±4ms     0.80  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 8192)
-         1.83±0s       1.43±0.07s     0.78  circuit_construction.CircuitConstructionBench.time_circuit_construction(1, 131072)
-      37.3±0.2ms         28.8±2ms     0.77  circuit_construction.CircuitConstructionBench.time_circuit_construction(2, 2048)
-        538±30ms         414±20ms     0.77  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 2048)
-       216±0.5μs          166±8μs     0.77  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 8)
-         712±5ms          530±2ms     0.74  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 32768)
-      43.2±0.2ms       31.8±0.2ms     0.74  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 2048)
-     2.91±0.01ms      2.13±0.05ms     0.73  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 128)
-       2.28±0.1s       1.66±0.08s     0.73  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 8192)
-         176±2ms          127±2ms     0.72  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 8192)
-     2.44±0.08ms       1.76±0.1ms     0.72  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 8)
-      2.85±0.01s       2.01±0.05s     0.71  circuit_construction.CircuitConstructionBench.time_circuit_construction(5, 131072)
-       386±0.6μs          263±4μs     0.68  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 8)
-         493±2ms          328±7ms     0.67  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 8)
-      48.6±0.3ms       31.8±0.4ms     0.65  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 2048)
-     3.23±0.01ms      2.05±0.09ms     0.63  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 128)
-         3.17±0s       2.00±0.03s     0.63  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 131072)
-      1.49±0.01s         936±20ms     0.63  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 2048)
-         796±3ms          497±9ms     0.62  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 32768)
-      6.10±0.02s        3.79±0.2s     0.62  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 8192)
-        88.0±5ms         54.3±2ms     0.62  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 128)
-         198±1ms          121±1ms     0.61  circuit_construction.CircuitConstructionBench.time_circuit_construction(8, 8192)
-      1.46±0.02s         855±30ms     0.58  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 128)
-     6.98±0.04ms       3.89±0.1ms     0.56  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 8)
-      3.80±0.01s       2.10±0.06s     0.55  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 131072)
-        89.0±1ms         48.4±2ms     0.54  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 8)
-         335±1ms          182±5ms     0.54  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 128)
-         235±1ms          126±4ms     0.54  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 8192)
-        931±10ms          495±9ms     0.53  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 32768)
-        806±30μs         428±20μs     0.53  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 8)
-     3.87±0.09ms       2.03±0.1ms     0.52  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 128)
-        58.1±1ms         30.2±1ms     0.52  circuit_construction.CircuitConstructionBench.time_circuit_construction(14, 2048)
-     1.35±0.01ms         635±30μs     0.47  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 8)
-     5.28±0.04ms      2.45±0.03ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 128)
-      1.08±0.03s         500±20ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 32768)
-         274±3ms          126±4ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 8192)
-      4.42±0.02s       2.02±0.05s     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 131072)
-      68.6±0.3ms         31.2±1ms     0.46  circuit_construction.CircuitConstructionBench.time_circuit_construction(20, 2048)

Benchmarks that have stayed the same:

       before           after         ratio
     [4f30d98f]       [4e03197b]
     <master>         <no-more-numbers>
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 128)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 128)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 2048)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 32768)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8, 8192)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 131072)
              n/a              n/a      n/a  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 32768)
          104±8μs          116±4μs    ~1.12  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 8)
         478±20μs          523±1μs     1.10  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 128)
         567±40μs         602±30μs     1.06  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 128)
         571±50μs         601±50μs     1.05  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 128)
         32.3±2ms         33.9±1ms     1.05  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 8192)
         29.9±1ms       31.3±0.3ms     1.05  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 8192)
          161±7μs        167±0.8μs     1.04  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 8)
         31.0±2ms         32.1±2ms     1.03  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 8192)
         34.7±1μs       35.9±0.1μs     1.03  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 8)
       8.74±0.7ms       9.01±0.4ms     1.03  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 2048)
         120±10μs        124±0.5μs     1.03  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 8)
       7.34±0.2ms      7.53±0.08ms     1.03  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 2048)
         592±20ms         606±20ms     1.02  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 131072)
         34.0±1ms       34.9±0.5ms     1.02  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 8192)
        9.73±0.2s       9.93±0.09s     1.02  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 128)
       11.4±0.3ms      11.6±0.02ms     1.02  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 8)
       9.03±0.3ms       9.17±0.2ms     1.02  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 2048)
        11.0±0.2s        11.1±0.1s     1.01  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 32768)
       33.9±0.2ms       34.4±0.8ms     1.01  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 8192)
       43.0±0.8μs      43.5±0.08μs     1.01  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 8)
        10.2±0.1s       10.3±0.07s     1.01  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 8192)
       36.0±0.2μs      36.1±0.09μs     1.01  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 8)
          557±3μs        559±0.6μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 128)
          534±3ms          536±4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 131072)
          609±6ms          612±2ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 131072)
        9.86±0.1s       9.90±0.08s     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 8)
         466±20μs         467±10μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 128)
       14.6±0.07s       14.7±0.02s     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 131072)
      9.20±0.04ms       9.22±0.8ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 2048)
         643±30μs         644±40μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 128)
       8.21±0.4ms       8.21±0.4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 2048)
          133±2ms          133±1ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(1, 32768)
       42.4±0.4μs         42.4±1μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 8)
       35.2±0.4ms       35.1±0.6ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 8192)
       71.4±0.6μs       71.3±0.4μs     1.00  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 8)
       12.1±0.8ms      12.1±0.01ms     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 128, 128)
       37.2±0.3ms       37.1±0.4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 8192)
          150±2ms          150±2ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 32768)
          151±3ms          151±2ms     1.00  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 8)
          146±7ms          146±4ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 32768)
         591±20ms          588±8ms     1.00  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 131072)
       36.9±0.2ms       36.7±0.4ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 8192)
         179±20μs         178±20μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 8)
          588±6ms         584±10ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 131072)
          226±2ms          224±3ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 2048)
       2.51±0.08s       2.49±0.03s     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 2048)
         909±20ms         900±40ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 8192)
      8.93±0.04ms       8.84±0.2ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 2048)
        515±0.6μs         509±20μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 128)
       43.0±0.2μs         42.5±4μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 8)
        154±0.2ms          153±3ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 2048, 128)
          149±1ms          147±2ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 32768)
       8.32±0.4ms       8.22±0.6ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 2048)
       3.61±0.03s       3.56±0.06s     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 32768)
         563±30μs          555±2μs     0.99  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 128)
       8.46±0.1ms       8.33±0.3ms     0.99  circuit_construction.CircuitConstructionBench.time_circuit_copy(14, 2048)
      2.95±0.01ms       2.91±0.1ms     0.99  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8, 8)
          703±2μs         693±50μs     0.98  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 128)
          607±3ms         597±10ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 131072)
          10.2±0s       10.0±0.06s     0.98  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 131072, 2048)
      8.48±0.03ms       8.33±0.2ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 2048)
          146±5ms          144±3ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 32768)
          2.50±0m       2.45±0.04m     0.98  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 8)
       2.50±0.02s       2.44±0.03s     0.98  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 8)
          599±3ms          584±1ms     0.98  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 131072)
          2.83±0s       2.76±0.03s     0.97  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 8192)
          148±1ms          143±6ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 32768)
       149±0.09ms          145±2ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 32768)
          141±3ms          136±2ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 32768)
       36.6±0.5ms         35.3±2ms     0.97  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 8192)
          523±4ms         504±10ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 131072)
          624±2ms          602±8ms     0.96  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 8)
          146±5ms         140±10ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 32768)
        152±0.6ms          147±4ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 32768)
       35.7±0.6ms         34.3±1ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 8192)
          620±1ms          595±2ms     0.96  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 128)
       2.49±0.02s       2.39±0.02s     0.96  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 32768, 128)
          589±9ms          564±5ms     0.96  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 131072)
          145±3ms          139±2ms     0.95  circuit_construction.CircuitConstructionBench.time_circuit_extend(8, 32768)
          132±1ms          126±1ms     0.95  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 32768)
          600±2ms          569±9ms     0.95  circuit_construction.CircuitConstructionBench.time_circuit_copy(2, 131072)
          705±3ms          668±3ms     0.95  circuit_construction.ParameterizedCircuitBindBench.time_bind_params(20, 8192, 2048)
          601±3μs         567±30μs     0.94  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 128)
          580±5ms         547±10ms     0.94  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 131072)
          595±6ms         559±20ms     0.94  circuit_construction.CircuitConstructionBench.time_circuit_extend(20, 131072)
        19.8±0.5s        18.6±0.6s     0.94  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 131072)
       8.95±0.5ms       8.36±0.6ms     0.93  circuit_construction.CircuitConstructionBench.time_circuit_extend(14, 2048)
       67.9±0.6μs         63.2±4μs     0.93  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 8)
        1.24±0.1s       1.13±0.07s     0.91  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 8192, 8192)
         561±20μs         508±40μs    ~0.90  circuit_construction.CircuitConstructionBench.time_circuit_copy(8, 128)
      34.8±0.08ms         31.5±1ms    ~0.90  circuit_construction.CircuitConstructionBench.time_circuit_copy(5, 8192)
         561±10μs         503±50μs    ~0.90  circuit_construction.CircuitConstructionBench.time_circuit_extend(2, 128)
         311±20ms         277±20ms    ~0.89  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 2048, 2048)
        5.20±0.1s        4.62±0.3s    ~0.89  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 32768, 32768)
      8.52±0.01ms       7.57±0.6ms    ~0.89  circuit_construction.CircuitConstructionBench.time_circuit_copy(20, 2048)
         44.0±2μs         38.8±2μs    ~0.88  circuit_construction.CircuitConstructionBench.time_circuit_extend(5, 8)
       20.7±0.8ms       17.7±0.9ms    ~0.85  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 128, 128)
      8.16±0.06ms       6.91±0.4ms    ~0.85  circuit_construction.CircuitConstructionBench.time_circuit_extend(1, 2048)
        14.4±0.2s        11.4±0.2s    ~0.79  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 128)
        8.81±0.1s        6.71±0.2s    ~0.76  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 32768)
       5.82±0.03s       3.69±0.06s    ~0.63  circuit_construction.ParameterizedCircuitConstructionBench.time_build_parameterized_circuit(20, 131072, 2048)

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.
```



### Steps to reproduce the problem

Run circuit construction after #4591

### What is the expected behavior?

Circuit construction performs the same as before.

### Suggested solutions

Come up with a scheme for type checking that doesn't introduce so much overhead, like either changing the ordering or iexplicitly checking for numpy trpes instead of relying on `Numbers.integral` or if we can't come up with a performant alternative then we should revert #4591.



Discussion:
How about explicitly checking for several types, i.e. instead of 
```python
isinstance(numbers.Integral, ...)
```
do
```python
isinstance(int, np.int, np.int32, np.int64, ...)
```
?
I expect that would work and was one of the suggestions I left in the issue. But, we'll have to benchmark it to be sure
I had worked on #4591 with @Cryoris 
I will continue working on this issue too
How about explicitly checking for several types, i.e. instead of 
```python
isinstance(numbers.Integral, ...)
```
do
```python
isinstance(int, np.int, np.int32, np.int64, ...)
```
?
I expect that would work and was one of the suggestions I left in the issue. But, we'll have to benchmark it to be sure
I had worked on #4591 with @Cryoris 
I will continue working on this issue too

Resolving patch:
diff --git a/qiskit/circuit/register.py b/qiskit/circuit/register.py
--- a/qiskit/circuit/register.py
+++ b/qiskit/circuit/register.py
@@ -19,7 +19,7 @@
 """
 import re
 import itertools
-import numbers
+import numpy as np
 
 from qiskit.circuit.exceptions import CircuitError
 
@@ -118,7 +118,7 @@ def __getitem__(self, key):
             CircuitError: if the `key` is not an integer.
             QiskitIndexError: if the `key` is not in the range `(0, self.size)`.
         """
-        if not isinstance(key, (numbers.Integral, slice, list)):
+        if not isinstance(key, (int, np.int, np.int32, np.int64, slice, list)):
             raise CircuitError("expected integer or slice index into register")
         if isinstance(key, slice):
             return self._bits[key]


Test patch: