1) Nope. strlen returns a size_t value on the stack (or in a register depending on the architecture). strlen won't allocate any memory to hold its result.
2) Casting it's return value to (void *) is a pretty bad idea. All you are doing is taking a size_t value (say 8 in your example) and telling the compiler to pretend it is a pointer to a memory area.
None of this is really pthread specific, just normal C. If you want to use the void * as intended, the idea is that you return a pointer to some data structure you have allocated which then needs to be free by the caller.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void *testFunc( char * );
void *testFunc( char *s ){
size_t *returnMemory = malloc( sizeof( size_t ) );
size_t len = strlen(s);
*returnMemory = len;
return returnMemory;
}
int main( int argc, char *argv[] ){
void *valPtr = testFunc( "Test String" );
size_t *sizePtr = (size_t *)valPtr;
printf( "%p => %zu\n", valPtr, *sizePtr );
exit(0);
}