core: make sure base_data is bytes or Pdata

This was working fine (although not python3 ready), but was not tested
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-Master

failed ERP5.UnitTest-Master

failed ERP5.UnitTest-Zope2

passed SlapOS.Eggs.UnitTest-Master.Python2

passed SlapOS.Eggs.UnitTest-Master.Python3

passed Wendelin.UnitTest-Master