Thanks for your help, Phil. Combining your suggestions with some ideas from gamsock, I now have this code. In addition to being significantly faster, it will also work with any vector type (I think).
Best wishes,
-Ben
;; code
(define vector->c-buffer (c-lambda (scheme-object scheme-object size-type) void #<<end-lambda
if (!___TESTSUBTYPE(___arg2, ___sFOREIGN)) return ___FIX(___STOC_POINTER_ERR + 2);
memcpy(___CAST(void *, ___FIELD(___arg2, ___FOREIGN_PTR)), ___CAST(void *, ___BODY_AS(___arg1, ___tSUBTYPED)), ___arg3);
end-lambda ))
(define %c-buffer->vector (c-lambda (scheme-object scheme-object size-type) void #<<end-lambda
if (!___TESTSUBTYPE(___arg1, ___sFOREIGN)) return ___FIX(___STOC_POINTER_ERR + 1);
memcpy(___CAST(void *, ___BODY_AS(___arg2, ___tSUBTYPED)), ___CAST(void *, ___FIELD(___arg1, ___FOREIGN_PTR)), ___arg3);
end-lambda ))