You can alternatively use rhinoscriptsyntax/RhinoScript, RhinoCommon/import Rhino or ghpythonlib/NodeInCode:
import rhinoscriptsyntax as rs #RhinoScript
#dir can be a tuple, a Point3d or a Vector3d
scaled = rs.VectorScale(dir, length)
#start can be a Point3d, a tuple or a Vector3d
a = rs.AddLine(start, start + scaled)
import Rhino #RhinoCommon
#start needs to be a Point3d, direction a Vector3d, and length a float
a = Rhino.Geometry.Line(start, direction, length)
import ghpythonlib.components as ghc #ghpythonlib/NodeInCode
#anything that works in GH will work (but not RhinoScript Guids/uuids):
a = ghc.LineSDL(start, direction, length)
If the variables are inputs from the outside, you can name them as the component inputs. Also, you can choose ‘Type Hints’ for each input. Just right-click on inputs.
See also the component Help, by right-clicking on the component icon and choosing Help.