If it has a refcount, why not make it a GObject so that it's easy to create from non-C plugins (python via peasy for example).
I just copied what was in `TMTag` to implement it quickly but good point, it could be a `GObject`. I'm not so familiar with what might be necessary for non-C plugins but how does https://github.com/geany/geany/pull/3849 look from this perspective? Could anything be improved there?