This is a rebased version of #40936: - the first few commits are #41003, which is greenlighted for merging after the release - then there's #40923 - and some changes on top