I would like to inform you that none of the AV product on the market will be able to protect you from piping a bad script from the web. Case closed.
endpoint security is a great utopia to strive for, but to get there we ought to starts with having secure by default endpoints.
Its an extremely strict approach, but it does address the situation you're talking about.
In a perfect world, AV software wouldn’t be necessary. We don’t live in a perfect world. So we need defense-in-depth, covering prevention, mitigation, and remediation.