こういうコードにすると期待した動作をするようになりました
ありがとうございました

void test5(std::string str, ...) {
char buf[1024];
va_list args;
va_start(args, str);
vsprintf(buf, str.c_str(), args);
va_end(args);
printf(buf);
}
void main() {
・・・
test5("hello5 %d\n", 123);
}
//結果
//hello1 123
//hello2 1819043176
//hello3 1819043176
//hello4 1819043176
//hello5 123