The problem is not one of mutation. You're reassigning to a variable in outer scope *only if `o` is truthy*. You need to reassign every time:

```coffeescript
options = {}

doctest = (a, o) ->
  options = if arguments.length >= 2 then o else {}
  # ...
```

Functions which assign to variables in outer scope are confusing. It'd be great if we could avoid doing this altogether.