### Description

This is a followup to #85926.

As part of the ingest processing pipeline, we call `CollectionUtils.ensureNoSelfReferences(...)` to ensure that a script processor didn't accidentally introduce a circular object. However, this check is only necessary if we know there was the potential for a circular option, which can only happen with either a custom processor (a plugin where we have no control), or a script processor. We should be able to only call this sanity check if we know we need it, rather than for every document.
modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/ScriptProcessor.java
* Processor that evaluates a script with an ingest document in its context.
 */
public final class ScriptProcessor extends AbstractProcessor {
    public static final String TYPE = "script";
    private final Script script;
    private final ScriptService scriptService;
    private final IngestScript precompiledIngestScript;
    /**
     * Processor that evaluates a script with an ingest document in its context
     *  @param tag The processor's tag.
     * @param description The processor's description.
     * @param script The {@link Script} to execute.
     * @param precompiledIngestScript The {@link Script} precompiled
     * @param scriptService The {@link ScriptService} used to execute the script.
     */
    ScriptProcessor(
        String tag,
        String description,
        Script script,
        @Nullable IngestScript precompiledIngestScript,
        ScriptService scriptService
    ) {
        super(tag, description);
        this.script = script;
        this.precompiledIngestScript = precompiledIngestScript;
        this.scriptService = scriptService;
    }
    /**
     * Executes the script with the Ingest document in context.
     *