use offset instead of front buffer
rename back_buf -> buf, back_sz -> cap
copy in python, out of c again