OK, some more info: it's gdk_display_get_name() here
https://github.com/geany/geany/blob/master/src/socket.c#L288
which is slow. After commenting-out and leaving NODISPLAY, it starts fast. I'll try to put traces into GDK if I find something. In the worst case the gdk_display_get_name() call could just be ifdefed on OS X.