there are a few issues I overlooked, so more changes for the auto_buy(). Most important, I missed items for chars with 'free' status. There was also a hot-looping in case of little money.
After this performance wasn't as good as before, but a bit more hacks and now I get again somewhat nice figures, 0.08-ish.
I think if we really want performance, we should order and group process chars, but I'm not sure if there really is need for that in practice.
BTW I never seem to get scrolls for Casters. They are present in game/content/db/items_scrolls.json, but it seems they are not yet loaded? probably a known issue..