Per docs, it seems there is no way to enumerate all pages in the DB while also getting their redirect targets.
This query should not error out, but return useful results:
action=query & generator=allpages & gaplimit=max & redirects
Instead, it errors because of an internal optimization (which I'm guilty of). In theory, the prop=info should have returned the redirect target instead, but it also does not support this.