TIL that I can change a shell function in bash to a subshell function simply by changing from curlies to parens.
my_func () {
cd ~/some_directory || exit
SOME_VAR=234;
}
my_subshell () (
cd ~/second_directory || exit
SECOND_VAR=234;
)
my_subshell # leaves me in the same directory as I started from, with env unaffected, SECOND_VAR is not set in parent shell
my_func # leaves me in ~/some_directory and SOME_VAR=234