Hi,
Since current practice suggest to use the pathlib module instead of strait str/path/symlink/etc. I suggest to simply add a str() casting on 'filename' symbols in functions expecting a filename (like id_filename()). This would make filemagic transparent when using pathlib (Path('/tmp/myfile')), and avoid misleading error messages yield by ctypes.