V1.5 randomly hangs on import

### Describe the bug

Since upgrading to version 1.5.0 we are seeing issues where the process stalls on import. Through a core dump, it appears to be locking up [here](https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/__init__.py#L154). We run hundreds of processes in parallel and it will hang on only a handful (less than 10).

### Steps/Code to Reproduce

```
import sklearn
```

### Expected Results

it imports

### Actual Results

process hangs indefinitely.

### Versions

```shell
System:
    python: 3.11.3 (main, May 15 2023, 15:45:52) [GCC 11.2.0]
executable: /home/jcoder/git/neo/neo/pyenv/bin/python
   machine: Linux-6.1.87-x86_64-with-glibc2.31

Python dependencies:
      sklearn: 1.5.0
          pip: 24.0
   setuptools: 70.0.0
        numpy: 1.24.4
        scipy: 1.11.1
       Cython: 0.29.35
       pandas: 2.0.2
   matplotlib: 3.7.2
       joblib: 1.3.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /opt/anaconda/2023/envs/pandas2/lib/libopenblasp-r0.3.23.so
        version: 0.3.23
threading_layer: pthreads
   architecture: Zen
    num_threads: 64

       user_api: openmp
   internal_api: openmp
         prefix: libgomp
       filepath: /home/~~~~~~/lib/python3.11/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
    num_threads: 64
```

COMMENT:
Yes, it's very difficult to reproduce. To provide a little more info around the compute environment, @glemaitre, each import is done in its own process. We have 2 different ways to parallelize that have shown this behavior. The first way is via a Kubernetes Indexed Job (each process in its own container), the second way is through [SLURM](https://slurm.schedmd.com/documentation.html).  The Kubernetes jobs are on EKS in AWS so the instance type and size may vary, but I've seen it hang on all different types with different numbers of cores. 
@lesteve Thanks for the tips. I've been trying to find a concise way to reproduce and haven't had any luck so far. Once I'm able to, I'll walk through the above steps.
The processes may or may not start around the same time, however this doesn't seem to have much of an impact, in some cases the process that hangs is the only one scheduled on that node.


If it helps at all, here are the results of running one of the core dumps through pystack. `datalib_impl` is an internal package that has `from sklearn.feature_extraction.text import TfidfVectorizer` which is the first reference to sklearn
The filepath in this case seems to be `/opt/anaconda/2023/envs/pandas2/lib/libopenblasp-r0.3.23.so`, however in another core dump, it showed `/home/~~~~~~/pyenv/lib/python3.11/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0` as the filepath it was loading.
```  
    (Python) File "/home/~~~~~~/pyenv/lib/python3.11/site-packages/datalib_impl/fundamentals_support/tfidf_matcher/matcher.py", line 8, in <module>


    (Python) File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
    (Python) File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
    (Python) File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    (Python) File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
    (Python) File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
    (Python) File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    (Python) File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
    (Python) File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
    (Python) File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
    (Python) File "<frozen importlib._bootstrap_external>", line 940, in exec_module
    (Python) File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    (Python) File "/home/~~~~~~/pyenv/lib/python3.11/site-packages/sklearn/__init__.py", line 157, in <module>
        _threadpool_controller = ThreadpoolController()
    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/site-packages/threadpoolctl.py", line 403, in __init__
        self._load_libraries()
    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/site-packages/threadpoolctl.py", line 559, in _load_libraries
        self._find_libraries_with_dl_iterate_phdr()
    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/site-packages/threadpoolctl.py", line 596, in _find_libraries_with_dl_iterate_phdr
        libc.dl_iterate_phdr(c_match_library_callback, data)
    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/site-packages/threadpoolctl.py", line 584, in match_library_callback
        self._make_controller_from_path(filepath)
    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/site-packages/threadpoolctl.py", line 725, in _make_controller_from_path
        lib_controller = lib_controller_class(

    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/site-packages/threadpoolctl.py", line 810, in __init__
        self._dynlib = ctypes.CDLL(filepath, mode=_RTLD_NOLOAD)
    (Python) File "/opt/anaconda/2023/envs/pandas2/lib/python3.11/ctypes/__init__.py", line 376, in __init__
        self._handle = _dlopen(self._name, mode)
```

Labels: Bug, Needs Reproducible Code