If someone suddenly volunteered their views to me in an interview, I'd be skeptical of them because that'd be a weird thing to do and I'd imagine if they're going to mention it to me in an interview, then it's something that'll disrupt their work.
But, if it's just magic, and I just know by magic or some dark arts, then I'm not sure. Even in a state like Massachusetts or a city like Boston, close to 30% of people voted for Trump. Now, maybe that's because they didn't like Clinton or were naive about him or something, but... that's still 30% or close to it, and with the labor shortage we have especially in key industries like tech, I don't think that my hypothetical company could survive excluding ~30% of the applicants off the bat for something technically unrelated to their work. And that's in the most liberal, most democratic, most educated state in the country.
An example I have in my industry is that we have a lot of religious and ethnic diversity, but typically from India, China, and the Middle East. I know that a lot of my employees/peers have radically different political views than I do, as many of my peers are deeply religious. There's some statistical certainty that a large minority of my coworkers have very traditionalist views on the role of women, gender equality, and other traditionalist points of view... they're from places like Saudi Arabia, Turkey, Egypt, and more traditionalist/conservative provinces in India. Now, none of them can vote in American elections, so they couldn't vote for Trump or vote against Trump, but it's a safe bet that many share similar social beliefs to, say, Jeff Sessions. Their preferred book may be different, but the implementation of that book in their preferred society doesn't differ very much. I'm not in charge of hiring so this isn't something that I would ever be in a position to take action on, but it wouldn't be right (or legal) to disqualify those candidates based on that, even in the hypothetical situation of this thread where I know their traditionalist or conservatives views by magic.
The convenient and legal way to handle this when it comes to hiring is to state your company's social mission clearly, and make social mission a focus for hiring. If your company's social mission makes diversity a key lynchipin of the company, as many do, then someone who is against diversity (and I don't mean just racial diversity, but gender, racial, ethnic, sexual, age, etc, diversity) and makes it a part of their work identity, then they clearly wouldn't be a good fit for your company and would disrupt your company's goals. As part of our annual reviews, you're obviously judged on your work performance but a major section of the review is how well you embrace the company's mission which includes the social mission: People who are catostrophically bad at the social mission typically end up performing poorly in the overall mission of the company, and it's a matter of time before they weed themselves out or fall behind their peers, or are fired.
*Edit: ORiginally thought it was 60/40 Clinton/Trump in 2016, it was 60/32, forgot about Gary Johnson and 'other' on the MA Ballot returns.