Ultimately it's up to the DM, but it should carry some consequences other than making the character useless. Something similar to wild magic could be employed. It makes the character weaker in some aspects, but the character is not severely held back until regeneration is available. The implementation can vary from occurring on certain spells only, stopping after several successive successes, occurring on all spells, occurring on a cast by cast basis with no remedy other than regeneration, etc.
Depending on the type of character being played, the wild magic table could be altered to make it more applicable. If the character is particularly stealthy and avoids combat, the spells could range more into that type of magic. The backfires could prevent magic stealth and disguise from working properly, but there wouldn't be a punishment like fireball on self.
It really depends on how far you'd like to punish the player for doing something that they shouldn't have, but keep in mind that it will not be enjoyable for a character to lose all of their powers or be limited in a way that is a direct debuff instead of a workaround.