Notably, such a concept as a function having a local variable is beyond POSIX shell.
* https://debian.org/doc/debian-policy/ch-files.html#s-scripts
ash & dash are about 100kB executables (POSIX plus a tiny number of non-interactive improvments like 'local'), bash is 1100kB. Every shell and subshell.
If you are talking about interactive use, of course bash is the one to use, but for writing shell scripts, it is a 10X interactivity overhead" over dash.
The amount of gyrations I go through to account for the lack of arrays is easily 1000x worse than accounting for not having local variables.