Is it possible to hide a GameObject handles with an Editor script?

I’m trying to hide the Handles on a GameObject, so nobody can move, scale or rotate it. Is there any way to do this, whether in an Editor script or some other way?

Solved my own issue! This seems to work when placed in an Editor script: