There is a tool called bunster, it does exactly what you desire.
It compiles bash scripts to static binaries, supports a lot of other features like modules, native .env files support, static assets embedding and a lot more.
Link: https://bunster.netlify.app