Need a little python help. This is for use in field calculator. Goal is to write the WKB representation of geometry objects (in a feature class) to a text field, for the purpose of exporting to csv.
ArcPy supports writing WKB of geometry objects. See: https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/geometry.htm#P_GUID-BC466D06-360C-42BD-B198-DA4139B45F49
The basic expression to get the WKB is !Shape.WKB!, although that returns a bytearray. I believe it needs to be encoded and converted to a string. The output should look like this image:

The text in that image exports to csv as: "\001\006\000\000\000\001\000\000\000\001\003\000\000\000\001\000\000\000\012\023\000\000\314\276\362 . . . "