In games with hidden information, yes. In open games? There is an optimal path from start to victory, for one of the players. No need to deviate randomly.
If you always play for the optimal move, give it a thousand games or so, and your opponents will know the optimal game.
They will learn the best opening move from your first move with white, the best reply from your response to it when they play it, white’s best second move from playing that against your best opening move, etc.
Once they know that, playing against them, all games will be the same and they’ll _look_ as good at chess as you.
Especially if the optimal move isn’t far better than the next best move(s) varying your moves can be used to show that isn’t true, and delay the time it takes your opponents to learn that optimal game.
That may well be true, but it isn't relevant. Game-playing engines are designed to win the position being played, not to maximize winning probability over its playing career.
Stockfish or AlphaZero don't care one bit about what happens in the next game they play.
It isn't necessary either. In chess, as there's no need to worry about interactions between players' information sets, a player can safely apply pure strategies. Winnings approach being maximized over player career by trying to match as close as possible subgame perfect equilibrium from any given start node per game.