It works a bit better now. But it still seems to prefer bent paths in some situations.
The empty belt is a test of the mod:
minimal underneathies (the selected underneathie was built after BR to show that path could be taken with same number of underneathies and less regular belts) (this path was generated with greed 1 and 1.1)
maximal underneathies
Minimal underneathies allowed took another path than the maximal underneathies mode! Not sure why that would happen. But only one of the modes seems to really care about minimising turns here. But it might just be because the underneathies with longer gaps are prioritised and that's the reason for more straight paths. But any maximal underneathie mode can trivially be modified to a minimal one by just replacing underneathies with regular belts wherever there's no obstacles to go beneath, so they could use the same path finder and then just transform between them, if you want simpler code.
Also for some reason "only necessary underneathies" seems to want to maximise regular belts by making gaps as small as possible. Not sure why that is.