The real-time scanning slows down processes that access a large number of files, like code compiles in general and importing node modules in particular.
The machine was slicing up 11 channels of 24fps videos into jpegs, so 264 jpegs/s at 720p and 24 bit color.
I've had friends and coworkers that have hit the same CPU issues with big git repos and defender.
It seems like Defender has problems with getting hit with tons of small files in quick succession, but really I know very little about it.