Implement a circuit-extension algorithm that can resist quantum computers

The design component for this is #17272 (moved) ; proposal 249 (see #17279 (moved)) will also be needed.