import machine
import usocket
import gc
socketObject = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
socketObject.close()
gc.collect()
machine.reset()
This is from my M1 MicroPython code. It might be what you need to reset your 3G.
Or you could possibly put the device into a sleep level that disconnects the modem.