This sentiment is currently spreading in the web dev community. It's the philosophy behind the Shadcn UI components. I also had the same thoughts about the machine learning space where people tend to rewrite much of the same boilerplate.
As a solution for some of the cases, I could imagine a structural editor with templates, blocks of boilerplate that cannot be edited but leave gaps or options for customization. This way, you have the whole context but make explicit, which parts are modified.