What is the best protoss counter to mutalisks if they sending a clump of them at your or your ally's mineral line? Is the only thing to do to Forge/cannon your minerals? I hate having to park a large group of stalkers there since they are needed to push out.
This question is pretty hotly contested, lol. My 0.02:
It depends strongly on *how many* mutas there are. If you've let the zerg macro up & he has 30 mutas, throwing down some cannons isn't going to save you. Even a bunch of stalkers sitting in your mineral line won't save you. Mutas are one of those 'critical mass' units. Once zerg has enough of them, zerg can pull down any unit/building very quickly & run away.
Against like 5 or 6 mutas, a cannon or two will do just fine. Unless you suspect that your opponent own't harass you at all (mutas, drops, whatever), having a few cannons in your base won't hurt. Yeah it costs minerals but as you mentioned, that added safety lets you move out & doesn't constrain your army. I'd say it's worth it.
Though for ^^ to be effective, you need to scout actively and be aware of common zerg timings. Like how fast can the zerg get mutas? How fast can zerg *safely* get to mutas? Putting down a cannon won't save you if it's like SURPRISE, 10 mutas in your face! lol On the other hand, if you see the spire going down (or better, see the spire), you can prepare. Anyway, turrets/cannons are my favored way of dealing with light muta harass.
So the question should really be... how do you prevent the zerg who started with like 6 mutas from getting 30+ of them?
The answer to that is aggression. You need to pressure the zerg so much that he never has time to get the expensive mutas & instead is spending on things like roaches/lings to stay alive. Move out early and hit him hard. Attacking has the added benefit of letting you see everything that's going on (i.e., if mutas are even on the drawing board). Keeping the pressure on is an excellent thing to do regardless.
If you leave the zerg alone for too long, he will get a crapload of mutas. If that's going to happen, you have a few options (combinatoins of the following) as far as I can see:
1) phoenixes: not sure how I feel about this, as you will need quite a few phoenixes. If you're comfortable w/using them to pick off mineral lines & lift units in battle, then go for it since they'll help you out. They can also buzz around and snipe overlords, which is great.
2) blink stalkers: in numbers, stalkers can put the hurt on. And blink prevents zerg from doing hit & run.
3) high templar: storm does heavy damage to mutas. Yes they can run but if they're all clumped up, you'll put the hurt on. And across several storms, they'll drop like flies. Just be careful to storm over where the muta's circle is on the ground, not on top of the muta object.
4) Armor or shield upgrades. The muta does like 9/3/1 base damage. With a +1 attack modifies that by +1/+0.3/+0.1 or so. So 1 level of upgrades will hurt the muta's damage potential a lot, as long as you are ahead in upgrades.
5) sentries! Roughly equal numbers of sentries win over roughly equal numbers of mutas (actually I think you can have like 3/4 as many sentries). As long as all the sentries are always under guadian shield. WAY MORE so than armor upgrades, guardian shield murders the muta's damage output. Have these guys around.
Of course, all this needs to be balanced against what the other opponent is doing... and what kind of ground army zerg has. A huge hoard of blink stalkers are of somewhat questionable value when put up against a MMM terran & a muta/speedling zerg, for example.
And if zerg has that big army of mutas, you can't just sit in your base & try to protect yourself from harassment. You'll lose map control & lose the game. Push out, doesn't have to be w/everything. Hit zerg's lightly defended bases. Or use the main army to nail his main base. He'll have to pull the mutas back at some point or try to trade bases with you (mutas aren't quite the best at killing buildings, so this should work out well). Keep in mind that a zerg with like 30 mutas won't have a ton of other units, so exploit this weakness.
As you noted, part of the point of the muta harass is to force the opponent to build a lot of defenses and/or commit army to base defense. If you just sit your units around waiting to push away harassment, you're letting the zerg win.