Just use POSIX-compatible sh instead of bash. It's also not hard to use mostly POSIX-compatible commands (grep, sed, cat, cp, mkdir ...).
For scripts where you need something unstandardized, say, imagemagick, you would wind up with up with a dependency in most other languages as well.
Actually, quite the opposite. All that shell scripts do is glue together other programs they depend on.
That makes them not portable. You can't just move a bash script from Linux to macOS because it uses ancient pre-GPLv3 versions of bash and all the other GNU utils.