As others have mentioned, there is an issue regarding the idiom. However you mentioned
Today, in an informal context I was asked what was the best strategy to keep a good weight according to my experience.
I imagined the conversation went something like this
Person: What's the best strategy to keep a good weight?
You: Keeping my mouth shut.
I thought this was funny because this is not the typical strategy. It's usually
Eat right and exercise.
So, having the conversation (that I imagined) in mind, I didn't think there was any ambiguity. I thought you meant stop eating/eat less, and in fact, I thought it was hilarious.
I agree that in other instances it could be ambiguous, but I'm not so convinced that this is one of them.
- Can I use the word shut in this context?
A simple definition of shut is
shut
: to close (something)
So, yes, you can use shut in this context. It is clear from context that you do not mean to be quiet, but instead you mean to imply stop eating (excessively), eat less.
- Close would have been a better word?
Not necessarily. In terms of meaning, they mean the same thing (from context). The only difference that I can think of is that shut might be considered rude or aggressive to some people. So using close instead of shut might be better, in that sense.
- Does shutting the mouth always impliesimply shutting up?
It seems you are referring to the meaning "to be quiet". However, you just constructed an example in which it does not mean to be quiet. So, no, it does not always mean to be quiet.