For that real solution you need to have a manager who approves spending time on removing unused cruft. Otherwise you'll end up smuggling refactoring inside other tasks, which is terrible for quality control.
I think this is really the crux of the matter. More generally, STABLE management that drives software quality. Even if you're lucky enough to be part of a team that starts of with good management, reorgs, mergers, and turnover are just way too frequent to provide the year-over-year improvements needed for really good, efficient code.