Fix ignore files behavior in doctests
In the doc tests (which btw I'm aware they're disabled), the `ignore_files` uses a mutable default value, so it's modified (e.g., when `__init__.py` is appended), it modifies the value for the next function calls that also use the default value (that don't set the arg).

I also fixed typing issues in the file and other minor issues.