Yes and no (beside $z there is $w as well)
There is one main difference when using above approach: you do not generate trash on each time you call the function. You can manually control when the string is freed which can be of importance when you use that with longer strings for example. BM does not cache them so if you call the function 20 times with the same string it will generate the same temporary c string 20 times, send it and destroy it again.
There is one main difference when using above approach: you do not generate trash on each time you call the function. You can manually control when the string is freed which can be of importance when you use that with longer strings for example. BM does not cache them so if you call the function 20 times with the same string it will generate the same temporary c string 20 times, send it and destroy it again.