I find that those who actively use Machiavellian management techniques can easily be disarmed by those who know how to actively counter them. Also, many of the Machiavellian techniques that work great against company-loyal Baby Boomers and Gen-X'ers can be quite disastrous against the Millenials.
For those who just don't like managing Millenials, you better get used to them. There are a lot more of them and you'll be ahead of the game if you can work out some effective techniques for leading them without resorting to Renaissance era tyranny.
Who would want to be surrounded by people who view them as a politician?
The short version: You will almost certainly find yourself confronted with the need to participate in office politics sooner or later. Best you accept this fact now and learn at least the modicum necessary to defend yourself, because taking the stance that your principles place you above it all will only make you a target. Moreover, equating participation in office politics with Machiavellian bastardry is at best enormously naïve; sufficient acumen, which is well within the capabilities of almost any skillful programmer, will enable you to play a positive-sum game.
The long version:
In some organizations, it's unnecessary to know anything about office politics, because they don't exist -- a rare and happy state which obtained for the first decade of my career, and was fine as far as it went, but which left me utterly unprepared to deal competently with them once my desire to advance my career and my craft made it necessary for me to do so.
In some other organizations, or so I assume, it's unnecessary to know much about office politics because, while they exist, it's possible to avoid participation. I can't speak to such situations from personal experience, but presumably they call for at least some modicum of knowledge on the subject, in order adroitly to avoid having any stance on a political matter -- at the very least, you'd need to be able to identify such matters, in order to avoid letting sheer ignorance betray you into taking a stance.
In most organizations, as far as I can tell, it is absolutely necessary to know something about how to play the game, because you're required to sit down at the table simply by virtue of being part of the organization at all. In such a situation, there are absolutely no advantages to the belief that your principles require you to remain above it all.
On the one hand, the attitude that political acumen is unworthy of you will lead you into ignorance which will eventually betray you in the fashion I describe above. On the other, it'll be more or less impossible to preserve indefinitely the belief among your fellows that you're simply innocent of it all, which is the best you can hope for; eventually, people will realize that you regard the whole matter with contempt, which they will take personally, whether you so intend it or otherwise.
This being the case, once your true opinion of the matter becomes apparent to your fellows, your days in the organization are numbered, because however they'd otherwise be inclined to regard you, you have just given everyone a reason to regard you as a political enemy, and rightly so -- after all, no one loves being held in contempt, nor should he.
Having thus disposed of the question of the value, or lack thereof, inhering in the principled stance above politics, all that remains to consider is one's degree of competence in that realm, and the only sensible opinion here is that one should develop as much competence as her natural talent makes possible. Just as with any other skill critical to one's successful pursuit of her career goals, it makes no sense to aim for any lesser degree of attainment.
Given my own experiences at the hands of office politicians, I can certainly empathize with your apparent distaste for that entire realm of human endeavor. On the other hand, those same experiences lead me to regard the principled stance above politics as arrant foolishness, because if you're in an environment where such politics exist at all, your alternatives are but two: you may retain your principled stance and rely upon good fortune, which will eventually exhaust itself and more probably sooner than later, to save you harming yourself through careless ignorance; or you may study the subject, at least to the extent necessary to arm you in self-defense, and ideally to the rather greater extent which will allow you to play the game as necessary, to the benefit of both the organization and yourself.
After all, just because the game of office politics is so often played in unprincipled fashion, you need not also behave in a manner unequal with your own principles. You just need to be good enough at the game to get away with it, and that's another matter entirely. Whether Machiavelli's opus is of value in such a pursuit, I cannot say, because it's been many years since I read it, and I've never done so with an eye toward the direct personal utility of such advice. But if you're going to be stuck playing the game, wouldn't you agree that it's better to do so well than poorly?
(Update: For an example of what I mean by "playing the game well", see [1], where I describe how to avoid both the risk of coming off as an unmotivated time-server, and the risk that your colleagues will feel like you're outdoing them and making them look bad.)
Granted, it strongly suggests that the job wasn't really worthwhile that I was able to talk myself out of that job so quickly, especially as a result of presuming a technical question (from my political animal of a direct manager) to be honestly motivated and giving an honest answer thereto. That said, on the one hand, given time I could've inveigled my way across the org chart into a more stable and less politically dangerous position, and on the other hand, I could've saved myself a great deal of suffering had I simply not shot off my big mouth right at the start.
Given that that error cost me an opportunity to redress, free of charge, my lack of tertiary education, I can only evaluate the matter as an overall failure on my part. On the other hand, I did manage to learn a great deal from it, both about office politics in general and about the peculiarly vile strain of same which infests academia, so at least I was able to salvage something from the wreckage.
In any case, I can't overstate the value of the sort of political caution advocated here. It may be hard to believe if you, as I, first encounter office politics relatively late in your career, but all it takes is to shoot off your mouth just once, and piss off the wrong person in so doing, to completely destroy any future you might have had in an organization. And, sure, any organization in which that's possible is one where you might not want to work anyway. But you wouldn't be considering taking a position there if there weren't some benefit in it for you, and making the same mistake I did can very easily cost you your shot at whatever makes the job worthwhile.
Seems to me moving companies you means losing all the people who owe you favours, and whose respect you've earned by being good at your job.
Starting your own company, consulting, or becoming a famous blogger/internet celebrity are all options, but they seem to mean doing a lot of nontechnical work.
Switching companies gives you breakthrough jumps. Staying at the same company will only get you a slow arduous climb.
The Prince: http://en.wikipedia.org/wiki/The_Prince
1: make friends with everyone, avoid making enemies. Make sure you have read "How to win friends and influence people."
2: make a good first impression, get some big wins under your belt in the first six months and impress. Your reputation at your new company will persist for years and it will largely be defined by your initial achievements.
3: politics: either avoid it entirely, or play it very well. If you're playing, make sure you have read "The Prince". If you're playing, make sure you win. If you play and lose, you should move on.
4: do more listening than talking.
5: if you are ambitious, commence your ladder climb after six months of points 1, 2, 4 above.