No need to steal this, I would guess that a “limiter” is what is wanted here, and there are plenty of algorithms available. It won’t take away from the dynamics of the audio either, it will merely cap the loudest parts so that one isn’t exceedingly loud while the next is normal.
The readme actually explains the algorithm used: https://github.com/xoxorwr/pw-loudness-eq#the-limiter
It has to be stolen because the open source ecosystem is incapable of doing the kinds of actual engineering required to produce this and make it work well. A controversial statement, but a correct one.
It's not the algorithm, it's the tuning of that algorithm. I guess that Microsoft tested this across a bunch of different computer speakers and users. Likely resulting in something that is optimal for nobody but reasonably good for a broad range.