Have you ever looked at the source code of the NT kernel? (there have been a few leaks over the years)
Windows is indeed full of old and new crust, but the foundations are actually not bad, NT is a pretty good kernel if you ask me.
The quality of Microsoft engineering is often underestimated, mostly because it is all over the place, different teams, a huge amount of technical debt, but in my opinion some key pillars have been built well enough and maintained, and they also managed to deal with the crust and survive without falling into the classic trap of the second system syndrome.