*(int *)vector_expand(v) = 2;
We'll just have to agree to disagree that what you've shown above is an acceptable API for a vector module.