The important part is not that it is Python but that UI code is not directly synchronized. So if you try to change the game state in UI code the game state is only changed on one computer instead of all. Sending a message is the easiest way to trigger code that runs on all computers as all including the sending player receive the message.If it is a python mission you have to send messages to everyone that a player has done something. It is not necessary if it is not a python message. You have to do it when a human player gets an imagrant to join a city or when a human player selects from a list in an event.
Maybe you could just use the unit lost event which should be a synchronized event.