"Fast strlen" in C using scalar bithacks
Bug

strlen("\x80\x80\x80\x80\x80\x80\x80") does not return the expected 7.  The do loop does not distinguish between '\0' and '\x80'.

strlen("\x80\x80\x80") returns 0, 1, 2  or 3 depending on alignment.

These render  the function broken.

Why int32_t?

Certainly int32_t* marches down the sting at a 4x clip rather than a plodding char *.  Yet for a 16-bit int machine, int32_t* may be slower.  For a 64-bit machine, int64_t* could even be faster.   I'd expect a unsigned * to work fast or even fastest.  I guess that is why strlen() is a library function - each implementation is expected to use its own optimal approach.

Minor: Clearly use unsigned mask constants

With bit masking, shifts and subtraction, using unsigned math has less review concerns.

0x01010101 --> 0x01010101u.

Portability

while(... &amp; (sizeof(uint32_t)-1)) is a reasonable alignment test but not a specified correct one.  Conversion of a pointer to an integer need not follow the usual linear expectations.  I do not know of any implementation where this will not work, but it is not C specified.

Notes:
uint32_t is an optional type.  A unicorn platform may not have it defined.
uintptr_t is also an optional type.

Could use something like 

#include &lt;stdint.h&gt;
#ifndef UINTPTR_MAX
  #error "You are kidding me? An implementation without uintptr_t!" 
#endif


Comment nit

Mask off high bit should be "Mask off high bits" or "Mask off each byte high bit", ...

/* Mask off high bit */
i &amp;= HIGH_MASK;