Could he? Yes.
Has he already? I can pretty easily defend the proposition that a Catholic who votes for a pro-abort candidate because the candidate is pro-abort, or who votes for a pro-abort candidate when there is a perfectly reasonable pro-life candidate available, is committing a sin. If they understand that and do it anyway, it's a mortal sin.
Persons in mortal sin are not permitted to receive the Eucharist. The difference between such a person and one who is excommunicated is that the excommunicate may need to do more than just repent and go to confession to be back in the good graces of the church. (For example, he may need to make his repentance known to his bishop directly.)
Would it the excommunication you propose be a good idea?
That's a lot more tricky. Because of the different circumstances in different elections in different countries, it would probably have to be done on a case-by-case basis. And *that* would be seen as absolutely reprehensible interference by the Vatican in the internal politics of another country, and you would have the usual hue-and-cry from the usual suspects. Would it be a good idea?
There's a further issue I didn't address.
Would it really accomplish anything good if he did?
Do you think there are a lot of Catholics who just plain don't realize that they shouldn't be voting for pro-abortion candidates, and wouldn't do it if the Pope said not to?
Some people claim that the Pope could have "stopped the Holocaust" by telling Catholics not to participate in it. I would submit that someone who is not Catholic enough to understand that gassing innocent people is a grave sin, and that it's bad to commit a grave sin, isn't going to be motivated to change by any number of Papal pronouncements.
C: Could he? Yes.
This is probably one area where the Pope and the RCC could come under criticism. Once it became known what was going on in Nazi Germany, what did the Pope do or demand of RC Germans? The centralized hierarchy cuts both ways. It lends itself to better discipline and responses but it also makes it easier to be held accountable.