It would not prevent an attack, unless it's really poorly coded. I never run VNs as a secure file. At least I run them in a sandbox (using Sandboxie). I also use a dedicated operating system for them (can be a separate PC or VM or SSD without access to other partitions or disks). I also would not trust an antivirus to detect a Python script made for a specific purpose a few hours or days before your download.
I suggest to have a dedicated operating system for porn that you won't use for anything else, without any shared password (even saved in the browser) where you can run not trusted software in a sandbox. It could also be in a Virtual Machine inside your main operating system. Drives are cheap even a slow 250GB/500GB/1TB SATA SSD is totally fine for Renpy VNs. Just don't give it access to your LAN. If you have a laptop, you can partition your drive if it's big enough (1TB at least so you can have 250GB for VNs). Partitions should be mutually exclusive (one should not be able to read, and write, the other).