I voted for the fourth option (yes, with a quest or similar for powerful items), but it doesn't really reflect my preferences exactly.
I'm comfortable with the Dungeon Master's Guide's rules on settlement size, gold piece limit, class demographics, et cetera et cetera. However, I also don't really want the "Sharper Image" feel in-game.
Therefore, my compromise solution is as follows: Assuming that the community the PCs are shopping in has a character who can create the items they want to buy, they can obtain the items. However, no spellcaster has anything but the most useful and inexpensive items "in stock"; no matter who you are or what you want above the level of, say, a potion of cure light wounds or similar, you're buying on contract.
All significant purchases of magic items, therefore, are roleplayed (the same way I would want to roleplay the purchase of a ship, for example). The cheapest items can be dealt with rapidly - "Yes, the local priest has a few healing potions on hand and doesn't mind selling them to outsiders, since they're easy to make" - but everything else requires a wait of a few days, a few weeks, a few months - time which I'd say it was unlikely the PCs would want to spend idle.
In this way, you prevent the instant gratification of simply being able to buy whatever magic gear you want and thus prevent taking it for granted. Sure, the Magister of Blackfalls can craft you a sword capable of slaying the demon who haunts the town's mines, but what are you going to do in the time it takes him? People are still dying down there, but they can't afford to close the mine for a month, and even if they did the demon might steal into town for victims. Even when magic is a solution, it's not necessarily going to be an immediate solution.
As for extremely powerful items, the NPCs capable of making them are going to be named individuals with influence over the campaign world commensurate to their power - again, not a straightforward "magic shop", and presumably crafting items that require exotic components or for which they require the party to perform a service; and what, exactly, does a hero do when the only woman who can create an item desperately needed to repel Hell's invasions demands their support in her usurping bid for the throne?
Basically, what I'm saying is this: cheap items are gear, moderately powerful items are roleplaying opportunities and plot devices, and hugely powerful items are plot incarnate. The scale slides to accomodate the party; a +1 sword might be gear for a 15th-level character equipping the three captains who lead his followers, where it was a major investment early in his own career.