It depends on the subject being taught, but in a lot of situations it wouldn't be about influencing them, it's about stimulating debate.
But a good teacher can stimulate debate without giving their own personal political opinion
The question will be asked: 'What do you think, Miss/Sir?' And if you fob your class off with 'It's not for me to say' or similar waffle, you're going to come off as completely fake and not worth engaging with. If we start enforcing neutrality, students will know that this is being enforced from above and it will be that much more difficult for a teacher to establish trust and rapport
The teacher could say, "it would be unethical for me to give you my own personal opinion in the classroom". Which would be the truth. They could add, "but if you see me down the pub in a couple of years, ask me again and I will".
Children are perceptive. They know when a teacher is being honest. Also know when a teacher is pushing their own personal political agenda.
Also, as a PP said earlier in the thread, there is the effect that some children will rebel against a teachers personal view, or anyone elders view, whatever they say. If a teacher repeatedly drones on about their personal opinions on climate change or "Trump is a racist" or whatever then it gets boring, just like it would for anyone. They know they are being lectured to by a political activist, whether they're in the classroom or outside of it