BUG: Fix segfault on dir of a DataFrame with a unicode surrogate character in the column name
Return a `repr()` version if the column name string is not printable. This also means the the column name is not present in the output of `dir()`

- [x] closes #25509 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Thanks for the PR! I'm not sure falling back to the repr is the right approach though. A call to print would raise:

```python
>>> colname = "\ud83d"
>>> print(colname)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud83d' in position 0: surrogates not allowed
```

So I think should do the same here I think this column name should be treated like other non-identifier column names. So this means that it gets ignored in `dir()`, but you can see it when you print the data frame. I have now pushed the check for printable characters up in the failing call chain. This is the only fix that I could think of which did not print any error messages.

I have also made a mini bug reproducing script that just calls the underlying failing pandas call:
```python
import pandas as pd
import numpy as np

a = np.ndarray(shape=(1,), dtype=np.object)
a.fill('\ud83d')
table = pd._libs.hashtable.StringHashTable(2)
print(table.unique(a))
``` can you run the algos asv's (e.g. the things that hit unique) and report the results. You lost me here, what are the algos asv's? Would be in regards to this:

https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#running-the-performance-test-suite

so from asv_bench folder run

```sh
asv continuous upstream/master HEAD -b algorithms
``` The results are a significant performance decrease for the string cases. (factor 2.3 to 1.4 worse)
I guess I have to figure out to reset the python error when the conversion fails. With the current patch:
```
       before           after         ratio
     [e72e2dd1]       [a52e59cd]
     <master>         <fix-25509-dir-failure-on-df-with-unicode-surrogates>
-      5.83±0.8μs      4.84±0.02μs     0.83  algorithms.Duplicated.time_duplicated(True, 'first', 'string')

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.
``` Another point is that I am not quite sure why the conversion to UTF-8 is needed to compute a hash value. If we can avoid the conversion, the hashing should even be faster. Thanks @roberthdevries another great PR

> Another point is that I am not quite sure why the conversion to UTF-8 is needed to compute a hash value. If we can avoid the conversion, the hashing should even be faster.

If you see a way to improve performance here would welcome a follow up PR