Global functions via Collection level folder?

Oct. 2020 and I’m dealing with the same. The reason I’m even needing this is to simplify calls like the following with a helper function. Anyone know a more elegant solution or are we still hooking with Object.prototype?

    // The order of function calls below determines the order of precendence
function replaceContext(val) {
    return pm.variables.replaceIn(pm.environment.replaceIn(pm.collectionVariables.replaceIn(val)));
  }