core: throw TypeError if chdir() args don't match signature
A little stab at #264 (closed). I'm doing my part!
The compat risk for changing this is pretty low. (there are a lot of other APIs implemented in C++ which should be changed in the same way)