Basically I want to split the template string by literal whitespace (we don't have to worry about escape chars for these purposes) and produce an array of strings, where bracketed arguments with space on either side are by themself, otherwise they're joined to either side where there's a literal string with no whitespace in between. The code within the brackets should (if possible) be interpreted like it would be in an f-string, e.g. {1 + 1} -> "2". Here are some examples of my desired behavior:
my_var = "test"
args(t"foo bar ") # ["foo", "bar"]
args(t"{my_var} bar") # ["test", "bar"]
args(t"foo/{my_var}{my_var} bar") # ["foo/testtest", "bar"]
args(t"foo/{1 + 1} bar") # ["foo/2", "bar"]