Demote self to an (almost) regular argument and remove the env param.
Fixes #10667 and closes #10259.