I think modularization of templates is really hard. Best thing I can think of is a cache e.g. for signatures. But then again this is basically what the mangling already does anyways in my understanding.
This seems incredibly wasteful, but of course still marginal better than just #including code which is the alternative.