RAW: Ambiguous
The rules are not clear on what, exactly, constitutes an “arcane spellcasting class” or a “divine spellcasting class,” probably because initially it was obvious. By default, assassins, bards, sorcerers, and wizards were the arcane spellcasting classes, blackguards, clerics, druids, and paladins were the divine spellcasting classes. There was no ambiguity: the former are the classes that cast arcane spells, and the latter are the classes that cast divine spells. Easy.
Then they printed things like Alternate Source Spell, Rainbow Servant, Sha’ir, and Southern Magician, which introduced ambiguity that hadn’t existed before. In these cases, you have spell slots from one class being used for either arcane or divine spells.
Does this new feature suddenly make the class into an “arcane spellcasting class” or “divine spellcasting class” where it wasn’t before? There hadn’t ever been a strict definition before, and they didn’t print one at this point, either. Some of these effects seem to try to include wording that prevents this kind of thing, but much of those rules are also unclear. For instance, consider this from Southern Magician: “The actual source of the spell's power doesn't change,” which Customer Service interpreted as preventing entry to mystic theurge. But it doesn’t really say that, does it? It says something about power source, which is unclear.
Unfortunately, there’s no direct, rules-as-written, “as it says on page xyz of Complete Shenanigans” kind of answer to this question.
Recommendation: Never
RAW is ambiguous, but what’s going to work well in-game is not: never, under any circumstances, should one be allowed to advance wizard spellcasting faster than the wizard does. That should never, ever happen in any game, and if you’re going to allow it you might as well allow Pun-pun.
Allowing these sorts of tricks to qualify for mystic theurge, and other prestige classes and feats that require one type of spellcasting or the other, is pretty clearly legal, RAW, and also usually far less troublesome. The only exception I’d be likely to make is the dweormerkeeper from Complete Divine’s web enhancement, but then I’d probably just ban that class outright.
Even allowing a divine-only prestige class to progress wizard spellcasting is almost-always not a problem. It’s the double-progression that should never, ever happen.
Technically, No.
You have already quoted the important information. Gaining new spells per day is not the same as learning new spells.
SRD for wizard states:
Spellbooks
At each new wizard level, she gains two new spells of any spell level or levels that she can cast (based on her new wizard level) for her spellbook. At any time, a wizard can also add spells found in other wizards’ spellbooks to her own.
Using Archmage for an example:
Spells per Day/Spells Known
When a new archmage level is gained, the character gains new spells per day (and spells known, if applicable) as if he had also gained a level in whatever arcane spellcasting class in which he could cast 7th-level spells before he added the prestige class level. He does not, however, gain any other benefit a character of that class would have gained.
But I haven't met any DM's that actually enforce that. I, as DM, don't enforce it either. Besides, even if you do enforce it, it isn't anything that can't be overcome with some gold and scrolls.
If access to that is difficult, then consider feats that adds spells to lists, and the Ancestral Relic feat that would allow you to pimp your spellbook.
Best Answer
You have identified the difference between practical and theoretical optimization. Theoretical optimization identifies only the end product in the presence of a "neutral but benign GM." Practical optimization is worried about the paths and the playability at all levels.
It is easy to state this goal, of course. In practice, this means rebuilding a character four or five (or seventeen) times to account for the discrepancies introduced during the creation process. It also means finding a way to experience the class at various choke points to be aware of the optimization level at each choke point.
Looking at the Theurge you gave in your example, it is immediately obvious that the opportunity cost of a 2 level multiclass is nominally intolerable for the "Thou shalt never lose caster levels" Tier 1 classes. Therefore, we can look for solutions which minimize this opportunity cost. Ur-priest, the various early-entry methods, race selection to maintain effective caster level, etc.
None of these tricks are difficult nor even non-obvious. However, this problem illustrates my Constrained Optimization paper nicely: a good character is about well stated requirements. It is a common failing of the theoretical optimizer that they do not sufficiently articulate their requirements such that the character is playable or fun.
Practically, there are many ways to mitigate "low-level" weakness in a character. They all start with a coherent level by level build of the character, the level goals, and the intended play style. By creating quantifiable requirements, it is possible to anticipate "low-level" weaknesses and therefore build around them.
The best way to do this, besides not taking the superficially optimal class that does not fulfill your requirements, is to offload common tasks onto class features/items that do not necessarily require a higher level to function. In the case of the theurge, careful spell selection will mitigate the one level dip into an arcane caster class due to various feats neatly. There exists sufficient variety in spells that the trade off of one divine caster level for arcane casting is easily balanced.
Will this create an 'optimal blaster?" It depends on your requirements.
By enchanting magic items with common healing spells, it then becomes less necessary for you to have a maximal number of healing/buffing slots available. By finding an attack method that is not tied to caster-level during these first few critical levels, the need for higher-level spell slots is reduced.
Therefore, the "optimal" strategy is to take a level of ur-priest and theurge from that. Barring that, precocious apprentice or earth spell will provide a much shorter entry into mystic theurge, making it a slightly less non-optimal choice to take. At the end of the day, this is an area that has been well researched with much literature. Searching the literature for your given set of requirements will show solutions that you can test against your requirements level by level.
Be prepared to spend significant amounts of time on practical optimization, especially in systems that do not lend themselves to trivial computational modelling.