import System # pip install pythonnet
pt0 = Rhino.Geometry.Point3d(0.0, 0.0, 0.0)
pt1 = Rhino.Geometry.Point3d(5.0, 5.0, 0.0)
line_curve = Rhino.Geometry.LineCurve(pt0, pt1)
# When calling .NET methods have return a value as an 'out' parameter,
# you need to pass as many arguments as the method requires.
# Since the concept of out arguments (or passed by reference)
# does not apply to Python, the trick is to pass some dummy arguments
# of the expected type.
dummy_out = System.Double(0.0)
rc, real_out = line_curve.ClosestPoint(pt1, dummy_out, 0.0)