Cache the automatically created path codes by their length.
pcolor, quadmesh etc. create lots of polylines of the same length, and
there is no need to create a new identical codes array each time.
(Definite speed improvement, incredible memory improvement).
Change the default behavior to create open paths (which don't result
in a memory copy). Fix places that were relying on
automatically-created closed paths to create closed paths themselves
(and thus avoiding a copy).