arecord comes already included with alsa.
lame would be relatively light to encode to mp3.
I concur, live recording to wav with arecord, editing with Audacity later and then encoding with lame/oggenc.
Recording a wav using arecord and then converting using LAME or oggenc is a perfectly good solution. Indeed, SoX records the audio and also produces an mp3 via LAME. For other than specialized transcoding requirements they are very similar. The result is that instead of learning the commands for both arecord and LAME or oggenc only the command for SoX is needed.
The idea of recording, processing with Audacity then converting is, again, unquestionably a good one. In circumstances where the hardware is struggling to adequately record audio via either Audacity or mHWaveEdit it is possible that loading and editing a large wav file will also be too heavyweight for it. On its website, SoX describes Audacity as "SoX's graphical soul-mate". In cases where GUI editing is unsuitable, the CLI app offers tools to conduct the most common functions of trimming, noise reduction, normalizing, and fading all in a more lightweight form.
As is so often the case, there are multiple ways to achieve one's goal.