Yes, it's completely safe (on most compilers). I'd recommend throwing in a break point and looking at how the assignment is being done on your particular compiler. I can't tell you how many times "standards" are violated.
If you're assigning a local static from the result of a function or method call, then you will likely be dealing with a race condition. Constant assignment to a primitive type will generally get optimized.
On g++ for OS X 10.6.2, this is the machine code generated for your function:
push rbp
mov rbp,rsp
lea rax,[rip+0x2067] # 0x100003170 <_ZZ7dostuffvE9somevalue>
mov eax,DWORD PTR [rax]
leave
ret
As you can see, there's no assignment. The compiler has baked the primitive in at build time.