@cvp yep...just realized that must be the reason, since CGFloat can be 32 or 64 bits, so isn't always compatible with a float.
I just changed things to this:
CGFloat_p = ctypes.POINTER(objc_util.CGFloat)
CGGradientCreateWithColors = objc_util.c.CGGradientCreateWithColors
CGGradientCreateWithColors.restype = c_void_p
CGGradientCreateWithColors.argtypes = [c_void_p, c_void_p, CGFloat_p]
locations = (objc_util.CGFloat * 2)(0.0,1.0)
gradient = CGGradientCreateWithColors(colorSpace, objc_util.ns(colors), ctypes.cast(locations, CGFloat_p))
and of course it works fine now. Should have realized that right away. I'll update the original thread as well.