This isn't really necessary now, as #2502 created an automatic remover for unused Tempcode parameters before things enter the block cache. It doesn't matter than unneeded parameters are generated prior to the cache being populated, as normative performance is after the cache is full.
This is a cleaner solution.