kwargs for open() and _io.FileIO()

This provides more CPython compatibility but is mainly done in work towards a fix for #874: the mode kwarg is fully implemented, and the encoding arg is allowed so now the tests can specify `encoding='utf-8'` which makes sure CPython uses the correct encoding for opening the files instead of the encoding derived from some environment variable.
The new (as of a few days ago) way to use the arg parsing machinery is to put the static arg list within the function, and to not #define a macro for the number of args.  See eg stmhal/can.c.