End the antiquated requirement for anonymous ballots, and the technical solution becomes very easy.
End anonymous ballots and you end democracy.
That's awesomely definite! I'll assume educated. Please explain to me how Athens successfully used a mix of anonymous and non-anonymous voting systems without ending democracy.
But neither should you be able to check an individuals vote anonymously. Coercing or discriminating against someone for their vote needs to become a serious crime before any of this could be put into place though.
How do you prove you were "encouraged" to vote a certain way? You can't, and even an attempt to sue for example your employer will affect your future in sufficiently negative way to make the prospect daunting. Nor can you prove someone wasn't so influenced. So the election result has zero credibility, thus delegitimazing the entire system. Which, of course, is the goal of various non-anonymous voting schemes that people suggest from time to time.
How can you prove you were abused a certain way? When victims start coming out of the shadows, it doesn't take much detective work to identify the patterns and psychopaths. But if you don't have a system in place which gives victims a fair chance of resolution, then they will stay in the shadows.
The solution is to fix the system rather than pander to the actors with bad intent - who enjoy more freedom to coerce currently then they would be under a thoughtfully considered mix of social and software engineering.