ToFarFunction = (farName, func) => {
  if (getInterfaceOf(func) !== undefined) {
    // @ts-expect-error checked cast
    return func;
  }
  // @ts-expect-error could be different subtype
  return Far(farName, (...args) => func(...args));
}
Coerce `func` to a far function that preserves its call behavior.
If it is already a far function, return it. Otherwise make and return a
new far function that wraps `func` and forwards calls to it. This
works even if `func` is already frozen. `ToFarFunction` is to be used
when the function comes from elsewhere under less control. For functions
you author in place, better to use `Far` on their function literal directly.

@template {(...args: any[]) => any} F
@param {string} farName to be used only if `func` is not already a
far function.
@param {F} func
@returns {F & RemotableObject & RemotableBrand<{}, F>}