TOS does reference the Prime Directive.
On stardate 3156.2, the USS Enterprise was trying to determine the fate of the starship Archon. After his entire crew was threatened with death by the Landru computer, Captain Kirk caused the computer to self-destruct by convincing it that it was harming the society that it was designed to protect. Kirk justified the interference by claiming that the society was not "a living, growing culture" and that as an arrested culture the Prime Directive did not apply to it. Following the destruction of the computer Kirk left behind a team of specialists to assist the planet with societal development in the absence of Landru. (
TOS: "The Return of the Archons")
This episode contained the first mention of the Prime Directive in Star Trek. It also was the first instance of the Federation taking on the responsibility for mentoring an entire civilization's population post-interference.
https://memory-alpha.fandom.com/wiki/Prime_Directive
And yes, many plots revolve around interpretations of the Prime Directive as situations force people to consider the spirit rather than the letter of that general order. It can be frustrating to see what appears to be contradictory decisions from characters however that is the nature of discretion. What makes sense today may not make sense tomorrow, even given almost identical criteria. Almost identical. It is never identical because at the very least the decision maker will have changed based on the experiences gained between the decisions.
I disagree that Kirk is always shown to be the best of us. He is a heroic character but not the best of humanity.
This is probably going to sound awkward but I see myself as “a good guy” and saw the USA as “the good guys” earlier in my life. I tend to think most protagonists think of themselves as “the good guys”. I have known many violent criminals who saw themselves as “one of the good guys”. And that conflict comes often from diametrically opposed “good guys”. So that kind of story resonates with me.
I no longer see the USA as so clearly “the good guys”, both the government and a large percentage of the population. This is part of what caused the cynicism and bitterness that is like a blight on me. I long for even temporary escapes from the disillusionment I feel and yet part of me hopes that things will find a way to improve. Progress has been made. The USA may feel worse than it was in the past but it is demonstrably better across the board than it has ever been. It ugh hope and striving to be better that things get better. I think Roddenberry believed that and expressed it through Star Trek.
I think seeing ourselves as “not the good guys” is counterproductive. Self loathing is not something I find enjoyable to watch. Nor do I think unethical behavior is merely being pragmatic.