This should be not too difficult to add. Most unclear is how to extend pint best for this kind of conversion.
The idea is to add methods get the corresponding UCUM string from pint quantities and pint units:
>>> q = 5 * ureg("m/kg**3)
>>> q
<Quantity(5, 'kilogram / meter ** 3')>
>>> q.to_ucum()
'kg.m-3'
>>> u = q.units
>>> u
<Unit('kilogram / meter ** 3')>
>>> u.to_ucum()
'kg.m-3'