If you put any character that is invalid in an environment variable name after the environment variable name, it will force the expansion. Example:
Then you can replace all instances of the invalid character with an underscore:
ec expand('$SHELL-$HOME')->substitute('-', '_', 'g')
I recommend you define your own function in your vimrc for this
return expand(a:str)->substitute('-', '_', 'g')
ec Exp('$SHELL-$HOME') as needed.
Or you could even do:
return expand(a:str->substitute('_', '-', 'g'))->substitute('-', '_', 'g')
and run it as
ec Exp('$SHELL_$HOME'). The only concern is if the unexpanded string contains hyphens or if the values of the environment variables contain hyphens.
Of course, it doesn't have to be a hyphen, it could be anything other than an alphanumeric or underscore. You might come up with some weird character that will definitely never cause undesired results. You could even use a single closing curly brace and use
expand('$SHELL}_$HOME')->substitute('}', '', 'g'), as long as the result will definitely not contain any