PERF: replace with list, closes #28084
- [x] closes #28084
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

based on the OP's example:

```
In [2]: df = pd.DataFrame({"A": 0, "B": 0}, index=range(4*10**7))

In [3]: %timeit df.replace([np.inf, -np.inf], np.nan)
5.18 s ± 423 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)    # <-- master
414 ms ± 7.19 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)   # <-- PR

In [4]: %timeit df.replace([np.inf, -np.inf], np.nan, inplace=True)
2.89 s ± 111 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)      # <-- master
69.6 µs ± 4 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)  # <-- PR

In [5]: %timeit df.replace([np.inf, -np.inf, 1], np.nan)
4.88 s ± 228 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)   # <-- master
466 ms ± 11.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  # <-- PR
```
