Importing sklearn takes too much time compared to other imports except spaCy

### Describe the bug

              Can you open a separate issue please with more details about your problem?

In particular, please include the following information in your new issue:
- is this a regression in scikit-learn 1.5, i.e. did your code work scikit-learn 1.4?
+ I tested other versions still same but it's slower than compared to older versions probably due to new features etc. But 1.5.1 less problematic than 1.5
- ideally a stand-alone snippet that reproduces the behaviour on your machine and that others can try to run. Without a stand-alone snippet to reproduce, there is very little we can do to help ...
`import sklearn` Takes 155 seconds to load. 
`from sklearn.metrics.pairwise import cosine_similarity` 384 seconds in my machine at python 3.12 and scikit-learn version 1.5.1 Windows 11 Latest version of Windows SDK and VM with 8gb ram. Other modules loaded less than 1 seconds. Full code of script: https://github.com/HydraDragonAntivirus/HydraDragonAntivirus/blob/main/antivirus.py
_Originally posted by @lesteve in https://github.com/scikit-learn/scikit-learn/issues/29145#issuecomment-2334105586_


### Steps/Code to Reproduce

`from sklearn.metrics.pairwise import cosine_similarity` 

### Expected Results

Excepted: Loaded in 2 minutes

### Actual Results

Results: `import sklearn` takes 155 seconds, `from sklearn.metrics.pairwise import cosine_similarity` takes 384 seconds

### Versions

```shell
Main machine: 
 python: 3.12.5 (tags/v3.12.5:ff3bc82, Aug  6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)]
executable: c:\Users\victim\AppData\Local\Programs\Python\Python312\python.exe
   machine: Windows-11-10.0.22631-SP0

Python dependencies:
      sklearn: 1.5.1
          pip: 24.2
   setuptools: 73.0.1
        numpy: 1.26.4
        scipy: 1.14.1
       Cython: 3.0.11
       pandas: None
   matplotlib: None
       joblib: 1.4.2
threadpoolctl: 3.5.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
    num_threads: 16
         prefix: vcomp
       filepath: C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\sklearn\.libs\vcomp140.dll
        version: None

       user_api: blas
   internal_api: openblas
    num_threads: 16
         prefix: libopenblas
       filepath: C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\numpy.libs\libopenblas64__v0.3.23-293-gc2f4bdbb-gcc_10_3_0-2bde3a66a51006b2b53eb373ff767a3f.dll
        version: 0.3.23.dev
threading_layer: pthreads
   architecture: Zen

       user_api: blas
   internal_api: openblas
    num_threads: 16
         prefix: libscipy_openblas
       filepath: C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\scipy.libs\libscipy_openblas-5b1ec8b915dfb81d11cebc0788069d2d.dll
        version: 0.3.27.dev
threading_layer: pthreads
   architecture: Zen
```
Notice: spaCy takes 1469 seconds to load.
Possible solution: Use multithreading or something similar at loading of import.

COMMENT:
No, I find the issue right now. If you compiled once the program, then it starts perfectly otherwise it will start very slowly. MrsMajor5.sys is not active don't worry and I removed it.
Before:
```
time module loaded
sys module loaded in 0.000000 seconds
os module loaded in 0.000000 seconds
shutil module loaded in 0.031705 seconds
subprocess module loaded in 0.015626 seconds
threading module loaded in 0.000000 seconds
re module loaded in 0.000000 seconds
json module loaded in 0.000000 seconds
PySide6.QtWidgets modules loaded in 0.205282 seconds
PySide6.QtCore modules loaded in 0.011022 seconds
PySide6.QtGui.QIcon module loaded in 0.005020 seconds
sklearn module loaded in 1.659113 seconds
joblib module loaded in 0.000000 seconds
pefile module loaded in 0.000000 seconds
zipfile module loaded in 0.000000 seconds
tarfile module loaded in 0.015648 seconds
yara module loaded in 0.000000 seconds
yara_x module loaded in 0.021181 seconds
psutil module loaded in 0.000000 seconds
notifypy.Notify module loaded in 0.057494 seconds
logging module loaded in 0.000000 seconds
concurrent.futures.ThreadPoolExecutor and as_completed loaded in 0.000000 seconds
watchdog.observers.Observer module loaded in 0.016019 seconds
watchdog.events.FileSystemEventHandler module loaded in 0.000000 seconds
time module loaded in 0.000000 seconds
win32file module loaded in 0.000000 seconds
win32con module loaded in 0.015630 seconds
datetime.datetime and timedelta modules loaded in 0.000000 seconds
winreg module loaded in 0.000000 seconds
C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\scapy\layers\ipsec.py:512: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  cipher=algorithms.TripleDES,
C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\scapy\layers\ipsec.py:516: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  cipher=algorithms.TripleDES,
scapy modules (IP, IPv6, DNS, DNSQR, DNSRR, TCP, UDP, sniff) loaded in 0.471905 seconds
ctypes module loaded in 0.000000 seconds
ipaddress module loaded in 0.000000 seconds
sklearn.metrics.pairwise.cosine_similarity module loaded in 385.033245 seconds
numpy module loaded in 0.000000 seconds
io module loaded in 0.000000 seconds
spacy module loaded in 2.546940 seconds
codecs module loaded in 0.000000 seconds
csv module loaded in 0.000000 seconds
elftools.elf.ELFFile module loaded in 0.126655 seconds
struct module loaded in 0.000000 seconds
zlib module loaded in 0.000000 seconds
marshal module loaded in 0.000000 seconds
base64 module loaded in 0.000000 seconds
base32_crockford module loaded in 0.000000 seconds
binascii module loaded in 0.000000 seconds
Total time for all imports: 390.248150 seconds
```
After:
```
time module loaded
sys module loaded in 0.000000 seconds
os module loaded in 0.000000 seconds
shutil module loaded in 0.015626 seconds
subprocess module loaded in 0.015627 seconds
threading module loaded in 0.000000 seconds
re module loaded in 0.000000 seconds
json module loaded in 0.015627 seconds
PySide6.QtWidgets modules loaded in 0.125675 seconds
PySide6.QtCore modules loaded in 0.031660 seconds
PySide6.QtGui.QIcon module loaded in 0.000000 seconds
sklearn module loaded in 1.248682 seconds
joblib module loaded in 0.000000 seconds
pefile module loaded in 0.000000 seconds
zipfile module loaded in 0.000000 seconds
tarfile module loaded in 0.000000 seconds
yara module loaded in 0.000000 seconds
yara_x module loaded in 0.015640 seconds
psutil module loaded in 0.000000 seconds
notifypy.Notify module loaded in 0.031696 seconds
logging module loaded in 0.000000 seconds
concurrent.futures.ThreadPoolExecutor and as_completed loaded in 0.000000 seconds
watchdog.observers.Observer module loaded in 0.015626 seconds
watchdog.events.FileSystemEventHandler module loaded in 0.000000 seconds
time module loaded in 0.000000 seconds
win32file module loaded in 0.015627 seconds
win32con module loaded in 0.000000 seconds
datetime.datetime and timedelta modules loaded in 0.000000 seconds
winreg module loaded in 0.000000 seconds
C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\scapy\layers\ipsec.py:512: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  cipher=algorithms.TripleDES,
C:\Users\victim\AppData\Local\Programs\Python\Python312\Lib\site-packages\scapy\layers\ipsec.py:516: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from this module in 48.0.0.
  cipher=algorithms.TripleDES,
scapy modules (IP, IPv6, DNS, DNSQR, DNSRR, TCP, UDP, sniff) loaded in 0.552973 seconds
ctypes module loaded in 0.000000 seconds
ipaddress module loaded in 0.000000 seconds
sklearn.metrics.pairwise.cosine_similarity module loaded in 0.078501 seconds
numpy module loaded in 0.000000 seconds
io module loaded in 0.000000 seconds
spacy module loaded in 1.509008 seconds
codecs module loaded in 0.000000 seconds
csv module loaded in 0.000000 seconds
elftools.elf.ELFFile module loaded in 0.063430 seconds
struct module loaded in 0.000000 seconds
zlib module loaded in 0.000000 seconds
marshal module loaded in 0.000000 seconds
base64 module loaded in 0.000000 seconds
base32_crockford module loaded in 0.002033 seconds
binascii module loaded in 0.000000 seconds
Total time for all imports: 3.776552 seconds
```

Labels: Bug, Needs Info