You're talking about shebangs in general. This is about a specific shebang idiom, i.e
#!/usr/bin/env python3
which allows the file to be run with whichever python interpreter the user has in their PATH, instead of requiring the interpreter to be in a particular location.
Re:On env Shebangs
by jbverschoor on Saturday April 16, 2022 @06:05AM
(#31051119)
Oh yeah you're right.. Didn't actually notice env xxx
No it doesn’t. It’s just there to specify which interpreter to use instead of the current shell, so you can rub it like any other executable. Has nothing to do with portability.