I would like to get a list of all possible keyword arguments a string template might use in a substitution.
Is there a way to do this other than re?
Why do you want to avoid regular expressions? They work quite well for this:
>>> re.findall(r'\$[a-z]+', "$one is a $lonely $number.") ['$one', '$lonely', '$number']
For templating, check out re.sub, it can be called with callback to do almost the thing you want.