There is no reason to consider one’s political party in local elections, if they are even a part of one, in local elections. Large social and economic issues simply do not matter for small positions such as city council or mayor. If you’re part of a large city such as NYC then sure but the vast majority of us aren’t. By the way, this only applies to the US because of our “wonderful” 2 party system.
The only problem with that is politicians have to get their start somewhere, and many times that is an a local election. So you wind up giving that person a head start.