PERF: refactor Series().str.get_dummies
State: closed

- [x] tests passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

No issue to link. No new tests.

Since `str_get_dummies` always receives just `Series` of strings, it's safe to transform it to python-native data structures and cut back some performance overhead. Works up to 2x faster and does not require Cython magic.

Script I used to test performance:
```python
import pandas as pd
import string
from itertools import cycle, islice
from timeit import timeit

letters_cycle = cycle(string.ascii_lowercase)
def letters(n):
    return list(islice(letters_cycle, n))

s1 = pd.Series(letters(3))
def f1():
    return s1.str.get_dummies('|')

s2 = pd.Series(letters(100))
def f2():
    return s2.str.get_dummies('|')


s3 = pd.Series(['{}|{}'.format(a, b) for a, b in list(zip(letters(10), letters(10)))])
def f3():
    return s3.str.get_dummies('|')

print('3 items:         ', timeit(f1, number=1000))
print('100 items:       ', timeit(f2, number=1000))
print('10 complex items:', timeit(f3, number=1000))
```

Current master:
```
3 items:          1.226549802115187
100 items:        4.812093775952235
10 complex items: 2.868986740009859
```

This PR:
```
3 items:          0.5505142270121723
100 items:        3.0751350841019303
10 complex items: 1.5680736750364304
```

Labels:
name: Performance
description: Memory or execution speed performance
name: Strings
description: String extension data type and string data

Comments:
you would need to show this is faster for a lot more items than this

we have asv for this - pls run them
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=h1) Report
> Merging [#18454](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/492040b401772e95b755f74f09b20ca236016fb5?src=pr&el=desc) will **decrease** coverage by `51.65%`.
> The diff coverage is `20%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/18454/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##           master   #18454       +/-   ##
===========================================
- Coverage   91.33%   39.67%   -51.66%     
===========================================
  Files         163      163               
  Lines       49695    49686        -9     
===========================================
- Hits        45389    19715    -25674     
- Misses       4306    29971    +25665
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `39.67% <20%> (-0.06%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/strings.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3RyaW5ncy5weQ==) | `36.08% <20%> (-62.39%)` | :arrow_down: |
| [pandas/io/json/json.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vanNvbi5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/formats/style.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvc3R5bGUucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/types/concat.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL3R5cGVzL2NvbmNhdC5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tools/hashing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL3Rvb2xzL2hhc2hpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/lib.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2xpYi5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/parser.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL3BhcnNlci5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas7bdat.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXM3YmRhdC5weQ==) | `0% <0%> (-91.08%)` | :arrow_down: |
| [pandas/io/sas/sas\_xport.py](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfeHBvcnQucHk=) | `0% <0%> (-90.28%)` | :arrow_down: |
| ... and [113 more](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=footer). Last update [492040b...985157c](https://codecov.io/gh/pandas-dev/pandas/pull/18454?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

It runs marginally worse for the asv benchmark. Closing this PR, will reopen if I find a way to beat current performance.