We can also try option `1)` in a little bit simpler form:

    # 1a)
    def write(self, path_or_envvars, envvars=None):
        if envvars is None:
            path = self._default_envdir_path(sys._getframe())
            envvars = path_or_envvars
        else:
            path = path_or_envvars
            # envvars already defined

        # ... existing Runner.write code goes here


I think it's the best solution.