For actual optimization of input files, [vpype](https://github.com/abey79/vpype)'s the one most people use.
Going back to really old/simple plotters, there wasn't enough code space to do any optimization. For example, the (fairly terrible) Commodore 1520 roll paper plotter had 2KB of ROM for all the 6502-compatible code its micro-controller used. When I first looked into the [firmware](https://e4aws.silverdr.com/hacks/6500_1/), I was pretty shocked that it printed text by scanning a table of character data from the start every time. Then I realized that even storing pointers for each character would use up about ⅛ of total storage, and the mechanical plotter mechanism was always way behind anything the code could do. So small mattered more than efficient
Feed it the ops, and they do those ops with precision and speed and will repeat all of that a zillion times.
Optimization was a front end process, if it was one at all.
That said, most professional graphics software knew how to break down their elaborate output into HP-GL primitives with an appropriate output driver for the plotter. So few users actually had to do this unless they were talking to the plotter directly through a BASIC program or something.
And at least on the 74xx, I have never experienced out-of-order execution of instructions, I'm skeptical that any plotters other than very recently implemented this as it would break assumptions made by a number of plotting packages if the plotter executed out of order. Many HPGL commands are highly stateful, considering how slow the on-board processor on these plotters was it'd probably make them net slower if they even tried to optimize.
The buffer is also very small in 'compatibility mode' but modern packages should be fine with the 'extended' buffer size that can sometimes fit a whole document if it's not too complex.
There is a feature in HP-GL that does make certain types of XY plotting simpler. While it's not a programming language like PostScript, you can scale, rotate and offset the plot by arbitrary amounts. HP instrumentation manuals claimed it was possible to directly plot experimental data by feeding it straight to the plotter after setting the scale. I feel this was a highly aspirational statement, and one not seeing much real use.
In the most recent reference guide I found just now, it seems you can draw a segment of a pie chart using a single EW (Edge Wedge) instruction but, for a complete pie chart, this method would require you to calculate the angles of each segment yourself. And of course to add the labels yourself. Perhaps I'm looking in the wrong place or perhaps the instruction to draw a whole pie chart has been deprecated.
Anyway, the HP pen plotter we had in the early 1980s was a very impressive device, when what we had were Z80 based computers driving them.
Yeah, but which had more? :) Reminds me of that time in the 90s(?) when people connected printers to computers, but the printers had more powerful processors than the computers. (Or later, when someone poked into the WiFi board on their arduino and realized that it was a more powerful microcontroller, but that's not so directly related)