Yeah fencing is useless since they generate from the crops themselves. I keep a pneumatic assault rifle loaded with all my farming gear and gun them down. Obviously it’s a pretty stopgap measure. Alternatively some type of autoturret on a vehicle works fairly well so long as you don’t get something too destructive that’ll bust up your crops.
If you want to be metagamey then just plant everything away from where your base is and only come back when the crops should be fully grown and just harvest it all real quick. Locusts won’t spawn if they’re outside the reality bubble.