Really, by that logic (the logic that it's not worth casting it, since you don't get 5000 xp), you should almost never expend resources on anything but a dragon. Like, say, if you encounter a nasty Bodak in an empty tomb, don't bother throwing any Holy Water or using a scroll of Sunburst ont, because he probably won't have any treasure. So what if he'll kill you? You just lost a scroll of Sunurst! You paid good money for that Sunburst!
See what I mean? So what if you lose some experience? If you didn't cast Miracle or Wish, the Tarrasque would eat you. If you'd rather be dead than lost a couple thousand XP, I'd say go ahead.
Edit: I think this sort of stems from the assumption that many players end up getting in their heads: They're only fighting these monsters and going on these adventures because they want to. Are you assuming that a high-level spellcaster, upon encountering the Tarrasque, can just decide, "Nope, I'm not gonna fight this." and walk away? I'd think Mr. T would have soemthing to say about that. Not to mention all of the other people in the world who were killed and eaten in Mr. T's rampage after the party decides to leave it alone because they might lose some resources.