fix callback bug where PyFunction is undefined for missing keyword arguments