After reading this very unpleasant next item (a dog whose muzzle was shut with electrical tape) I became curious: how would you humanely discourage, prevent or forbid a dog to bark excessively ?
As for many unwanted behaviors, a few points are of key importance.
Dogs are learning all the time. That means that everytime they bark they are in some sense becoming better at barking.
For unwanted behaviors prevention is the key. If you can list the circumstances in which your dog is barking, do it, and then try to avoid these situations (so long as you're not yet doing well with an alternative behavior, see below).
Many people know that their dog barks at other dogs in the street, barks at strangers, etc. and yet don't take actions. There is no shame crossing the street if you see other dogs approaching. We should remember that these kind of barking are a way for your dog to realise its anxiety, frustration, etc. That means these situation are quite negative for him in the first place, we should do our best to help them.
Train an alternative behavior
If your dog is chewing on a bone or playing with a toy in his mouth he'll be unable to bark.
That simple fact is actually quite useful in this case.
First teach/train your dog to enjoy taking a toy in his mouth in as many circumstances you can think of. That will take some time. Play with him, or give him a toy and then a food reward, be creative and make sure he enjoys it.
When he's enjoying that, as soon as he starts barking (the more precise timing you have the better) give him his toy.
That sounds simple but that's really a wonderful thing to do (and it generalises for other unwanted behaviors): the dog doesn't start a barking frenzy, you don't get upset, you and dog stay quite calm, as he's playing you can get his attention back to you, etc.
Don't reward the unwanted behavior
Barking is already self rewarding for the dog, that's why so many dogs go for some kind of compulsive barking (separation anxiety barking is the main example).
Additionally barking is sometimes rewarded without us realising it is the case. For example if a dog barks at stranger passing in front of their house, from the dog point of view barking is a good strategy as that person is eventually leaving.
That means we should certainly not unconsciously reward the dog. People yelling "stop it", or otherwise interacting with the dog are encouraging him to continue.
In conclusion, in cases where my first two points don't apply, just ignore it.
That's a tentative short list of potential reasons your dog might have to bark, along with some tips.
Barking at other dogs: that can be a truly fear related behavior or some kind of intimidating behavior (if the dog is uncertain about what will happen or is unsure about what to do). Only in rare cases is it a kind of pre-agression warning. That type of barking is really well covered by my first two paragraphs.
Barking when greeting people: that's very often out of true excitement. These are also learned behaviors. If you let him get excited when meeting one person he'll quickly associate that person presence with excitement to come and he learns to get more excited every time. Again prevention is really important here. If possible don't let that person approach if the dog is too excited. Or sent him back to his place/crate and let him approach when calm. My third paragraph is really important in this case: if you let that person approach/pet the dog, you'll be rewarding him.
Separation anxiety barking: I think this would be better addressed in a separate question.
Please do not use a shock collar ever on a dog. Punishment in animals creates a separation in the bond between trainer/owner and their animal. Who's to say the dog will even make the connection between the pain and the bark? The dog may just be barking at another animal, thinking that in doing so, he will scare off a potential threat. When you take that option away from them, they may develop more dangerous behaviours, such as lunging out or biting as barking (sometimes a defense mechanism) has been taken away from them so they feel the need to go to the next level as that option has been taken away.
Another point, dogs bark because they are dogs and it is a natural behaviour. You have not given any evidence of when and what the dog is barking at.
I know it can be very annoying to hear a dog barking all the time but, that's what most dogs do. If muzzle isn't working, try purchasing a shock collar, which shocks the dog every time it barks. Once the dog gets shocked a few times, it will then know what the collar does and how it works. Hope this helps!