The problem is not the casts made by FC_PTR_TO_INT(), but the parameter passed to it; there's a bad cast to get PTR for FC_PTR_TO_INT() to cast forward.
Yes, these macros within macros ending up making four or five casts from one type to the next might be a bit insane, but I'm for just fixing them in the stable branches. Any bigger restructuring should take place in development branch only.
Also to S2_6.
In C23 mode I've got compile failure from client options hash handling, that seems to be down to bad cast by FC_PTR_TO_INT()