How can I prevent Caml_option being imported into my JS?

Sometimes when I switch on an option, rescript will pull in some stdlib from ocaml, which typically creates an error and increases the bundle size

@scope("document") external querySelector: string => option<Dom.element> = "querySelector"
@get external src: Dom.element => string = "src"

let src2 = switch querySelector("script") {
  | Some(script) => script->src
  | None => ""
}
import * as Caml_option from "./stdlib/caml_option.js";

var script = document.querySelector("script");

var src2 = script !== undefined ? Caml_option.valFromOption(script).src : "";

Is there something specific triggering this extra wrapper from being added, and is there a way to workaround it?

@scope("document") external querySelector: string => Js.null<Dom.element> = "querySelector"
@get external src: Dom.element => string = "src"

let src2 = switch querySelector("script")->Js.Null.toOption {
  | Some(node) => src(node)
  | None => ""
}

The type of Dom.element is abstract, i.e. unknown, so it could contain undefined. The option type is unboxed only if the argument type is known not to contain undefined.
That said, querySelector returns null, not undefined (which is what None maps to), so the type of the binding is wrong.