I had something like this implemented for safely executing shell commands, by using metaprogramming:
name="A$ron"
z("echo Hello {name}")
Note that this is not an f-string. The z function expands the variables by parsing this string and accessing its caller's local variables.