If your ONT is already working with the Netgear router, installing OpenWrt and then configuring SQM (Network -> SQM) will make a big difference.
You can find links to the R8000's OpenWrt firmware on its device page: https://openwrt.org/toh/netgear/r8000
Then find the SQM configuration steps at: https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm
I have seen this multiple times in the past. Back then I briefly tried to figure out what was the script doing and uploaded it to termbin but looks like they erase old pastes.
Anyway lucky for us, Their MiTM server is still fucking compromised and someone else is using it to inject some javascript code. I haven't tried to figure out what is it doing this time but if you want to take a look I have included a link to the scripts in this comment.
The links will be up for 24 hour only because of hastebin's policies.
https://hastebin.com/pucireqime.js
There was another script that was being added, The URL to that script is, salutationcheerlessdemote[dot]com/sfp[dot]js
My firewall blocks this so I don't know what's there.
There are some additional (optional) parameters for SQM that may help a bit more. Those are explained in https://openwrt.org/docs/guide-user/network/traffic-shaping/sqm-details .