Hey Michael,
So I don't think we do support expanding python variables inside of backticks -- and to be honest I'm kind of amazed it hasn't come up before. Would you mind opening up an issue on github to track this? I think this is something we should support.
Now, having said that, one existing method to do something like this is to make use of pf-strings -- it isn't quite as tidy as your desired syntax above, but this currently works:
mydir = "somesubdir"
filelist = pf"/path/to/{mydir}".glob("f*.txt")
Note that `filelist` above will be a generator with matching pathlib path objects.
Hope that helps!
- Gil