I have observed, for a very long time, that my bots often fail to optimize the turn-angle. I don't understand why, but I have studied code from some OpenSource bots in the hopes of finding a GoToBot that succeeds in this. To my surprise I discovered that iiley's bots are goto-bots. Surprising because I have often studied the source of these bots without noticing this. Most of these bots are minis and they take quite a few turns in order to shrink codesize... Anyway, here's a translation of how iiley does it. (From comments in the code, credits should go to David Alves and Dummy here, but I'm not sure if they mainly contributed to the obfuscation, eh ... shrinkage ... or the algorithm as such).
You just pass the distance you want to travel and the bearing (in radians) to this function and it will sort out the shortest way to turn and what direction (forwards or backwards) to drive. The "atan(tan(angle))" stuff there does a sort of lossy normalization of any angle to the "-PI/2 -> +PI/2" space. It works much better than in my old goTo() functions. So here is the quite codesize-small goTo() of the development version of Tityus: