I would be fine with opt-in, but certain character concepts really lend themselves to having these kind of issues.
Sure, but that's why we go with opt-in, because otherwise it's just too much of a "low-hanging fruit" deal where most DMs are going to only harass the "usual suspects" whilst the others get a free pass (mix those metaphors!), mainly due to a lack of imagination on the part of the DMs.
Incidentally, every situation you described is something that has or can happened in a story, so it's not like those things wouldn't make sense, even if the rules don't support that sort of thing.
Absolutely, that's where I'm getting most of it from. In fantasy fiction Fighter-types and Rogue-types fairly often "lose their mojo" to injuries, depression, addiction, grief and so on. Arcane-types often lose their powers for reasons even they don't understand initially (this has been the plot of entire books). Divine types almost never appear in fantasy fiction (not with actual magic powers FROM GAWD anyway - and I can't think of even one with revocable powers), but that's a whole other discussion. But a lot of this would extremely novel to players, and as you say, it's not supported by the rules, and it's not really something people necessarily expect.
That is a very cool idea, but I don't think its worth that "rules over story" philosophy, which certainly isn't necessary for a story point like that, especially since the idea that even a god can't take back their powers has such far-reaching effects.
Oh they can take them back alright. From your cold dead body!
(You could probably also make a ritual so a willing or unwilling subject could have their powers repo'd by their god.)
I don't think it is rules-over-story as much as "create lore that doesn't encourage the idea that DMs should be snatching power from certain PCs".
Classes are a metafictional thing, not a specific thing in the worlds themselves.
So this is the question, are they? And D&D is inconsistent on point in most editions. 4E was the one where classes were least metafictional and most "an actual thing in the world", I think. 5E is more vague on this point.
I think whichever way you go, consistency actually matters here, Emerson noted (he's usually misquoted anyway, it's "foolish consistency" he didn't like, not all consistency). It's kinda dumb if Cleric is an actual class but Fighter is purely metafictional.
Notably the first attempt truly all-round "fix" D&D, and one that prefigured 3E, 4E, and 5E in many important ways was Earthdawn, and one of the key things Earthdawn did was to make sure all the classes were NOT metafictional, but very much real things, part of the world, not just part of how we think about a game.
There are hundreds of infinitely better designed games to play if you don't care about the fiction. On the flip side, if you care about the fiction there are hundreds of infinitely better designed game to play.
So the summary is that there are hundreds of infinitely better designed games than D&D? I mean I can't entirely argue with that...