This MR addresses #3781, and implements the idea in #3781 (comment 524704)
For now, it's just up to get a look at CI.