This is a Gnome feature whereby C libraries are accompanied by an XML description of functions and types. The XML description annotates semantics, not only syntax. Like if a function has a pointer parameter, does it have to be malloced, and does the caller free it or the callee? This information is not possible to determine from parsing C header files.
If you can parse the GObject XML, you can then generate FFI bindings (which can be done in Lisp easily without any textual code generation hacks).
The second step builds a .typelib file which is a mmap()'able data-structure used at runtime by dynamic languages. It's smaller as it doesn't contain things like function/class documentation.
Additionally, the language bindings tend to use the GIRepository base structure which handles loading those mmap()'able data structures with an C API on-top of it.
These may be of special interest:
A lightweight QML-only ECL binding to Qt5/Qt6 : https://gitlab.com/eql/lqml
CLOG - The Common Lisp Omnificent GUI : https://github.com/rabbibotton/clog
Having a machine format that describes the interface and facilitates auto-generating the bindings, like GObject introspection is a better option and exists today. Even then the auto-generator will need to be custom for each language, to handle integration with the language's standard library data structures, memory management and the like.
Experienced engineers know D.R.Y. has it's uses, but isn't a good hill to die on.
Additionally, it works extremely well with GTK 4 via Pango and you can often interoperate between the two layers if you even need to touch a hb_face_t/etc. In fact, the only time I had to mess with Harfbuzz was when integrating GPU-rendered glyphs via Behdad's GLyphy shaders.
There is an alternative from IBM, ICU, it was properly coded in C, but it was switched to toxic c++.
I mean, I don't use it, and I've been writing C for a solid 25 years, but Behdad is one of the best engineers I've ever met in my life. So I definitely don't share your opinion of the code or the quality.
Carefull, I am not saying plain and simple C is better: it is only orders of magnitude less worse as there is already way too much in its syntax. Some would call that, the "most reasonable compromise".
But I get the impression that the syntax is a fixable problem. Usually critics point so something like the template system or something.
But please let me edit the sample text in the OpenType features modal, so I can actually see the effects of my changes without leaving the entire Font window :)
https://blog.gtk.org/2022/09/19/inside-the-gtk-font-chooser/
...but did they fix the file picker yet?