Ref T13250. This internally calls replaceQueryParam(X, null) now, which fatals if the second parameter is null. I hit these legitimately, but I'll look for more callsites and follow up by either allowing this, removing alter(), fixing the callsites, or some combination.
(I'm not much of a fan of alter().)