On a Micro, the USB communication is handled in the main processor instead of in a co-processor. I am trying to build a thing that uses a different sort of serial communication (LocoNet). If possible, I'd like to terminate the USB driver to free up resources, but not before it has sensed that there is no physical USB connection present.
This way, one could connect a PC to the board's USB socket for update- or debug purposes, but if no PC is present, the board would shut down the USB driver and continue with its normal programming (and thus the other type of serial connection).
If you need more ressources use a more ressourceful microcontroller
depending on the number of IO-pins ypu need this could be a
Arduino-IDE programmable
Seeeduino XIAO 32 kB SRAM 256 kB FLASH
Why not use a board that has an FTDI connector? Then you plug in the USB-serial adapter to program/configure, and remove after that. Pro Mini for example...
What exactly, is your resource problem? That might be easier to solve, than throwing solutions at it (I don't want to upset you, but the phrase that comes to mind is "band aid").
would it take a Wiz to code?
Depends on your definition of "Wiz" but it might be a kind of, "lf you have to ask, the answer is yes".
Not sure how many resources would be freed up, but there is a Serial.end() function that on other arduinos frees up the Tx/Rx pins for other uses. That particular part does not apply to an atmega32u4 since the Tx/Rx pins are already a separate serial port, but it may free up some ram since the rx/tx buffers are no longer needed.