>>106149240memcpy, in the way it's implemented does a lot of things. On most modern OS, it will copy pages using CoW which will reduce memory usage and prevent useless copy if you didn't plan to modify the copied data anyway, though that only applies for large chunks.
Also there's a benefit of having memcpy as a library feature instead of as a language construct. Say you have a compiled program for bare minimum x86 cpu. Then at runtime the memcpy implementation may choose a more suited alternative targeted for your specific instruction set. Windows has a feature to dynamically choose which function you want to use for each symbol. Elf does something similar with IFUNC
extern void memcpy(unsigned *data, size_t len);
void memcpy_c(unsigned *data, size_t len) { /* ... */ }
void memcpy_sse42(unsigned *data, size_t len) { /* ... */ }
void memcpy_avx2(unsigned *data, size_t len) { /* ... */ }
extern int cpu_has_sse42(void);
extern int cpu_has_avx2(void);
void memcpy(unsigned *data, size_t len) __attribute__((ifunc ("resolve_memcpy")));
static void *resolve_memcpy(void)
{
if (cpu_has_avx2())
return memcpy_avx2;
else if (cpu_has_sse42());
return memcpy_sse42;
else
return memcpy_c;
}