This relands #122991 (eeefa72). The last attempt at landing this caused some problems; I’m not entirely sure what happened, but it might have been due to an unnecessary use of the `template` keyword in a few places. This removes that and attempts to land the change again.