It's 'common knowledge' that certain cities/regions have mild weather because they're surrounded by mountains. E.g. this page Sitges Tourist Guide claims that:
Ask any Sitges resident about the weather in their town and they will proudly tell you about the microclimate in the area. Sitges is protected by mountains, providing it with a climate that is unaffected by surrounding areas. It could be pouring with rain in Barcelona and the sun could still be shining in Sitges.
Likewise a random property in New Zealand claims that:
Here in Tukurua we are protected by mountains from the cold south winds in winter so we enjoy a micro-climate in which snow is unknown, but snowfalls are common in July and August on the mountains surrounding Golden Bay, making for a beautiful backdrop to our wonderful scenery.
I've heard similar claims about even bigger regions, such as whole countries, but I can't find any English-language quotes. E.g. this page mentions that the Czech climate is mild because the country is surrounded by mountains.
Is it true that being surrounded by mountains can make the local microclimate less windy and rainy, as well as more warm?