It took about three years, but WordPress 4.5 finally introduced a solution, the pre_handle_404 filter: https://core.trac.wordpress.org/changeset/36629.

My approach was incorporated into the final changeset, so I received “props” on the 4.5 release – https://ethitter.com/2016/04/more-unexpected-props/.