The pgpkeydump page links to... six pages about GPG in the "Much has been written about this" part.
GnuPG is one of the cases where "rewrite it in rust" helps a little. rPGP and sequoia-openpgp offer somewhat reasonable library interfaces. pgpkeydump depends on sequoia.
With a rewrite you also don't get maintainer issues like https://twitter.com/FiloSottile/status/1355194247482384392 either.