I like to use the CustomDisplay class for rendering simple vector based graphics (i.e. no line styles) from GHPython (the legend in my solar hours thingie is an example). There’s a couple of caveats though, read more here:
CustomDisplay