If the source is known, it is not less bad that downloading a program and running it
Look into tailscale's installation script, they wrapped everything into a function which is called in the last line — you either download and execute every line, or it does nothing.
It usually happens on large files though, due to simple statistics, but given enough users, not hard to imagine it happening with a small script...