Glitches being cheating is really more for personal preferences, and glitches being allowed in a speed-run is not always entirely true.
For example the select glitch in Metroid 2 is banned in by a lot of speed-run sites including SDA due to how much it can screw up your game, same with the save corruption glitch in Pokemon Yellow. (although these are allowed for TAS but only 'cause they're meant to show how broken the game is.)
Personally I don't find any glitch in games cheating, as it's entirely the developers and beta testers fault for not finding the glitches and removing them. (and actually I remember a thread quoting that Miyamoto himself said that glitches are like unintended features in the game.)
yeah 3rd party hacks or altering the coding is definitely cheating.
I believe what you're referring to is something like a Action Replay or Gameshark. in this case I agree with you 100%.
Also what do you mean by TAS that uses cheat codes in an emulator Anon? all a TAS is is a input file that someone made while playing the game frame-by-frame. If a TAS where to have been made using a game-genie code it wouldn't show in the final product. (unless the one recording the AVI turned on the code which I seriously doubt they would anyway.)