core: make argument "errors" optional in function string_replace_with_callback