The trick is via something called Extending. Pyrex just makes extending a bit easier, but, depending on the complexity of the function, it might be easier just to extend it yourself. Basically you make a function that translates python into C. There are some instructions on the Python website, http://www.python.org . Look around, and you'll find lots of cool stuff on it.
-- http://mail.python.org/mailman/listinfo/python-list