Mandatory voting in a chambers warded with antimagic sigils. If you're not on the census, you're not allowed in but held until the election is over.

Now you just need to secure the ballots and the counters; similar chamber, adjacent to the voting location. Now it's just a matter of faithful public servants.

It's a bit draconian, I admit, but there's just no way to secure the entire adult populace against magical influence while any but an absolutely tiny proportion of them are running around free. FWIW, this cuts down on a lot of mundane voter corruption too.

The biggest problem with this, of course, is that a government that slips toward tyranny gets a golden, shining opportunity to dispose of dissidents every election cycle.