https://github.com/elastic/elasticsearch/pull/97304 removes several places that might do an expensive rebuild of the cluster state via `getStateForMasterService`. There's one other call we should be able to remove, in `JoinValidationService`, but it's a little tricky since we rely on seeing the last-accepted state for the cluster UUID validation, and it's not obviously ok to expose the last-accepted state without the no-master block.

This is a fairly minor issue because we do not do this join validation during elections, only if we're the elected master, and in that case `getStateForMasterService` is cheap. But that's not guaranteed, and we should strengthen this to avoid the that expensive step whenever possible.
server/src/main/java/org/elasticsearch/cluster/coordination/Coordinator.java
import java.util.Optional;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static org.elasticsearch.cluster.coordination.NoMasterBlockService.NO_MASTER_BLOCK_ID;
import static org.elasticsearch.core.Strings.format;
import static org.elasticsearch.discovery.SettingsBasedSeedHostsProvider.DISCOVERY_SEED_HOSTS_SETTING;
import static org.elasticsearch.gateway.ClusterStateUpdaters.hideStateIfNotRecovered;
import static org.elasticsearch.gateway.GatewayService.STATE_NOT_RECOVERED_BLOCK;
import static org.elasticsearch.monitor.StatusInfo.Status.UNHEALTHY;
public class Coordinator extends AbstractLifecycleComponent implements ClusterStatePublisher {
    private static final Logger logger = LogManager.getLogger(Coordinator.class);
    
    public static final Setting<TimeValue> PUBLISH_INFO_TIMEOUT_SETTING = Setting.timeSetting(
        "cluster.publish.info_timeout",
        TimeValue.timeValueMillis(10000),
        TimeValue.timeValueMillis(1),
        Setting.Property.NodeScope
    );
    
    public static final Setting<TimeValue> PUBLISH_TIMEOUT_SETTING = Setting.timeSetting(
        "cluster.publish.timeout",
        TimeValue.timeValueMillis(30000),
        TimeValue.timeValueMillis(1),