mangler: do not mutate mangle() argument
function: workarounds for PyPy bugs