I'm not sure why you think it would be a security risk, the capability to end processes via script already exists via /run, /dll and $com.

Also, if your virus scanner is letting anyone kill it then your virus scanner sucks.