You can use $sformatf(“format”,arg1,arg2) which returns a string that you can assign to a string variable, or pass as a string argument to a task. You can replace your for loop with
foreach (extra_bit[i]) strvar = {strvar,$sformatf("%b ,", extra_bit[i]);
You can also do this in one statement using %p if you are OK with the simple formatting it provides.
strvar = $sformatf("%p", extra_bit);