No, political beliefs are a protected class in practically every first world country, but excluding the US; in most states (excluding, IIRC, California - which matters a lot here) it would be legal for a private employer to fire an employee for being a member of the Democrat or Republican party.
The key employee anti-discrimination law is the Title VII of the Civil Rights Act of 1964 which prohibits employers from discriminating against applicants and employees on the basis of race, color, religion, sex, and national origin - but not political affiliation.
I don't understand the point, all of the firms mentioned in the OP are headquartered and have the majority of their staff in California, where it's illegal to fire for political beliefs.
State, federal or Civil Rights Act or not, it's illegal.
California Labor Code 1101 and 1102 LC expressly forbids it, including retaliatory actions (which is a much lower bar than firing).
In California, being passed up for promotion or being discriminated against in ANY way as a result of your political beliefs or activities is illegal.
Whether or not it’s strictly illegal to, for example, blacklist people from their professions for being suspected members of the Communist Party, at some point we agreed it was a bad thing to do so.
I guess the question now is, was there a general principle behind that, or are we just cool with Stalinism now?
The key employee anti-discrimination law is the Title VII of the Civil Rights Act of 1964 which prohibits employers from discriminating against applicants and employees on the basis of race, color, religion, sex, and national origin - but not political affiliation.