Backports for 0.25.3
This includes pieces of #27826 except for the whatsnew note, which appeared in 0.25.1. Not sure if we want to move that here or keep as is, but test and implementation were included here