Cythonized crafting.py