Change the shell that functions use
You can turn the function into a shell script and define the shell to be used in the first line

#!/usr/local/bin/bash

# the content of your function goes here


Then make the shell script executable and put it somewhere into your PATH.