Dependent on merging of https://github.com/JuliaLang/julia/pull/58269, would be great to also expose initiation of scratch space in calls to `median`. When `median` is on a hot loop, allocation of this scratch space can become a bottleneck.