Change the API and test for an empty buffer in RB_pop