"Now, consider if a foreign government did this with a custom malware that isn't picked up by ordinary antrivirus."
An "ordinary antrivirus" like MS Defender or McAffee (that's what my work PC has) is not able to detect malware from internet. A state actor has no issues installing malware on an accessible computer with Windows