I can't think of a better name than ``to_primitive``, so let's add a docstring:

```
Serialize ``value`` to a primitive type suitable for transmission over RCP or insertion into the database
```