After some further investigation, it seems the issue is related to curly parentheses, the following will work in Rhino 5 but not in Rhino 6:
import rhinoscriptsyntax as rs
...
line = rs.AddLine(point_a, point_b)
name = "{my line}"
rs.ObjectName(line, name)
print rs.ObjectName(line)