There are two related C standard rules:
C99 standard, 6.3.2.3:
6.3.2.3
A pointer to void may be converted to or from a pointer to any i
I wouldn't risk it. The standard makes it abundantly clear what is allowed and what is not allowed.
Writing uintptr_t s = (uintptr_t)(void*)p; signals to a reader of your code that you know what you're doing.
uintptr_t s = (uintptr_t)(void*)p;