BASH is quite a different language from my usual. And starting with it feels like going back in time somehow, when everyone knew some Assembly or something. To make it a little easier to handle I've written some helper functions... just like everyone else I suspect.

Anyhoo, here's one I use regularly for function arguments.

A pretty common way of calling a function with arguments and using them in the function might look like:

function some_fn () {
local msg=$1
local val=$2
echo "msg [$msg] val [$val]"
some_fn haha 6
but instead you can do this:
function new_fn () {
echo "msg [$msg] val [$val]"
new_fn msg haha val 6

The script treats all arguments to the function as name-value pairs introduces them as variables into scope using local.
There is a setting variable in the script that can be changed to introduce a prefix to the variable names if you want to clearly mark the variable as an argument (perhaps "A_" which will result in the variables in the example being named A_msg and A_val).

You can download the script here

This is much more like what I'm used to in JS and PHP where you can name your arguments, the merits of which seem great.