libpg_query is a godsend of a library. I spent a lot of time writing a custom parser before I found it - was very happy to replace the whole thing. A major boon was the fingerprinting ability - one of my needs was to track query versions in metadata.
On the topic of PG-specific C -- there are a handful of replacements for common operations that you use in PG. Things like "palloc/pfree", and the built-in macros for error and warning logging, etc.
I genuinely don't think it would take a motivated party more than a day or two to pick all of these up -- there aren't that many of them and they tend to map to things you're already used to.
It's true that the core PG code isn't written in a modular way that's friendly to integration piecemeal in other projects (outside of libpq).For THIS PARTICULAR case, the pganalyze team has actually extracted out the parser of PG for including in your own projects:
https://github.com/pganalyze/libpg_query