Is there an igraph C function to compute the common neighbors of two vertices v1, v2?
No, there isn't. Sorting the neighbor vectors in O(d log(d)) and comparing the sorted lists in O(d) is the way to go if you are using the library from C. Python, R and Mathematica all have built-in set functions that make this a whole lot easier.