For the subset of SymPy that SymEngine can do, the syntax here https://github.com/symengine/symengine.f90/blob/52f16d89bc4c489135d632a20544fd05475d4508/test/test_basic.f90 is actually not bad, and it’s a great starting point. The type(Basic) is implemented here: https://github.com/symengine/symengine.f90/blob/52f16d89bc4c489135d632a20544fd05475d4508/src/symengine_basic.f90#L9 and I can see that it is using a finalizer to correctly deallocate things, so I think this approach will work and not leak memory, while keeping the syntax quite natural.
We can follow the same approach to wrap SymPy into Fortran, much like Julia does it.