This interface isn't just a workaround for my python problem. It's a new
interface for both Geany and plugins because the existing methods to query tags are poor (inflexible and inconsistent), such that I wouldn't want to even export in the first place. For plugins there isn't any method provided by Geany ATM, just the global workspace (with bare tag arrays) is exported.
To me it looks more like a solution for your problem (which is fine) than something that would be needed in Geany. The current search functions in TM are indeed single-purpose for specific uses in Geany but there's no problem to grab one of the tag arrays, go through the elements and pick those you are interested in (one for loop, one if inside and this is more flexible than some extra API). The new API seems to be useful just to make the filtering fast in Python (and again, sounds like a fair reason).