See, that's what makes designing 2D levels a challenge. You've got to make sure that the natural design of the level stops or slows the player before they run into hazards they can't see. For example, make it so that there is a raised block right before a death pit, so that the player runs into it and stops, giving them time to react. Naturally, this could get repetitive, so you've got to be creative in how the level presents its hazards with time to spare.
Thokking, on the other hand, isn't such a big deal. Only an idiot would Thok excessively in 2D levels, so you don't really need to worry about that.
This is all a very roundabout way of telling you that, no, there isn't a way to turn off Sonic's thok. Unless you added in a custom character that looks like Sonic but has no Thok ability, and used FORCESKIN in your levels to always force the player to use that edited character.