Issue 1:
I'm building scipy from the latest source for the first time, running on Ubuntu in WSL2 on Windows 11. I tried following the conda guide, but am getting errors when building. Searching around for the error it seems like it might be a unix/dos file ending mismatch, but I'm not sure how to fix it.

Terminal output:

(scipy-dev) scott@DESKTOP-M5S4AGS:/mnt/c/Users/Scott/Documents/Documents/Coding/scipy$ python dev.py build
💻 ninja -C /mnt/c/Users/Scott/Documents/Documents/Coding/scipy/build
ninja: Entering directory `/mnt/c/Users/Scott/Documents/Documents/Coding/scipy/build'
[1/1533] Generating 'scipy/_lib/_ccallback_c.cpython-310-x86_64-linux-gnu.so.p/_ccallback_c.c'.
FAILED: scipy/_lib/_ccallback_c.cpython-310-x86_64-linux-gnu.so.p/_ccallback_c.c
/mnt/c/Users/Scott/Documents/Documents/Coding/scipy/scipy/_build_utils/cythoner.py ../scipy/_lib/_ccallback_c.pyx scipy/_lib/_ccallback_c.cpython-310-x86_64-linux-gnu.so.p/_ccallback_c.c
/usr/bin/env: ‘python3\r’: No such file or directory
[2/1533] Generating 'scipy/_lib/_test_deprecation_call.cpython-310-x86_64-linux-gnu.so.p/_test_deprecation_call.c'.
FAILED: scipy/_lib/_test_deprecation_call.cpython-310-x86_64-linux-gnu.so.p/_test_deprecation_call.c
/mnt/c/Users/Scott/Documents/Documents/Coding/scipy/scipy/_build_utils/cythoner.py ../scipy/_lib/_test_deprecation_call.pyx scipy/_lib/_test_deprecation_call.cpython-310-x86_64-linux-gnu.so.p/_test_deprecation_call.c
/usr/bin/env: ‘python3\r’: No such file or directory
[3/1533] Generating 'scipy/_lib/_test_deprecation_def.cpython-310-x86_64-linux-gnu.so.p/_test_deprecation_def.c'.
FAILED: scipy/_lib/_test_deprecation_def.cpython-310-x86_64-linux-gnu.so.p/_test_deprecation_def.c
/mnt/c/Users/Scott/Documents/Documents/Coding/scipy/scipy/_build_utils/cythoner.py ../scipy/_lib/_test_deprecation_def.pyx scipy/_lib/_test_deprecation_def.cpython-310-x86_64-linux-gnu.so.p/_test_deprecation_def.c
/usr/bin/env: ‘python3\r’: No such file or directory
[4/1533] Generating 'scipy/_lib/messagestream.cpython-310-x86_64-linux-gnu.so.p/messagestream.c'.
FAILED: scipy/_lib/messagestream.cpython-310-x86_64-linux-gnu.so.p/messagestream.c
/mnt/c/Users/Scott/Documents/Documents/Coding/scipy/scipy/_build_utils/cythoner.py ../scipy/_lib/messagestream.pyx scipy/_lib/messagestream.cpython-310-x86_64-linux-gnu.so.p/messagestream.c
/usr/bin/env: ‘python3\r’: No such file or directory
[6/1533] Generating scipy/generate-version with a custom command
fatal: bad revision '^v1.8.0'
[10/1533] Compiling C object scipy/special/libcephes.a.p/cephes_gamma.c.o
ninja: build stopped: subcommand failed.
Build failed!

Issue 2:
I ran into a problem running dev.py that appears to be caused by the shebang line #!python3 in the file scipy/_build_utils/cythoner.py. If I change it to #!/usr/bin/env python then the build works fine.

Most files in scipy with a shebang line use #!/usr/bin/env python. Only files in the _build_utils use #!python3.

Error message when running python dev.py build:

Meson build setup OK
💻 ninja -C /mnt/c/Users/Jozsef/OSS/scipy-test/build
ninja: Entering directory `/mnt/c/Users/Jozsef/OSS/scipy-test/build'
[3/1562] Generating 'scipy/_lib/_ccallback_c.cpython-310-x86_64-linux-gnu.so.p/_ccallback_c.c'.
FAILED: scipy/_lib/_ccallback_c.cpython-310-x86_64-linux-gnu.so.p/_ccallback_c.c
/mnt/c/Users/Jozsef/OSS/scipy-test/scipy/_build_utils/cythoner.py ../scipy/_lib/_ccallback_c.pyx scipy/_lib/_ccallback_c.cpython-310-x86_64-linux-gnu.so.p/_ccallback_c.c
/bin/sh: 1: /mnt/c/Users/Jozsef/OSS/scipy-test/scipy/_build_utils/cythoner.py: not found
[12/1562] Compiling C++ object scipy/_lib/_uarray/_uarray.cpython-310-x86_64-linux-gnu.so.p/_uarray_dispatch.cxx.o
ninja: build stopped: subcommand failed.
Build failed!

If I try running cythoner.py directly:

-bash: /mnt/c/Users/Jozsef/OSS/scipy-conda/scipy/_build_utils/cythoner.py: python3: bad interpreter: No such file or directory

I'm using conda with WSL (Ubuntu).