At the time of writing this isn’t possible, twentytwentytwo works around this by registering patterns in a subfolder then using a pattern block.
This way they can define patterns in PHP then use the functions. This is how they show the bird in the header and include localised strings.