Mouse pointer moving on arrow keys pressed

Tried killing all running processes on my PC till the problem went away and I can now say for sure the culprit was...

Microsoft Paint

(classic Win32 one)

Apparently it's got a feature that allows moving the mouse pointer using arrow keys, and for some reason sometimes it doesn't stop listening when the window loses focus, so Paint was running in the background since I often use it and it was still doing its job of moving the mouse.

This also explains why the problem can persist after a reboot: when you reboot Windows while Paint is running, Windows will automatically "save your work" and reopen Paint at system boot, causing the bug again!