I assume you're talking about the pack_map.c used during build? That just was written in C because I had the .map parser already lying around from another side project. If I had done it from scratch for this project it likely would have been JS or PHP, too.
I don't know for sure, but I would hazard a guess that it would take up less space, if memory serves, I don't think PHP has pointers for example and I guess things like that would be more space efficient in c.
PHP has a pack() function that can write arbitrary bits, and if you like things extra-gnarly, you can manipulate arbitrary structs (and pointers) with FFI. But if there’s already a parser in C, it makes sense to use it.