If your goal is to scan the files before they hit the filesystem, scanning the data in memory after the web server handles the upload from a HTTP form is unlikely to resolve that, because almost every web server implements file uploads as streaming writes to a temporary file anyway. Buffering the whole file in memory is wasteful, and quickly becomes a recipe for an out-of-memory denial of service (OOM DoS) attack.
If you're receiving a file from the client via some custom transport (e.g. over a websocket) you should consider the same approach - receive a chunk, write it to a temporary file, keep your in-memory buffer small. While 10MB doesn't sound like a lot, an attacker only has to initiate couple of thousand uploads simultaneously to completely knock your web server offline.
Malware only becomes malicious if you actually execute it, or give the attacker some way of causing it to be executed. As such, as long as you place it somewhere where it won't be accessed in such a way (i.e. out of the webroot and not in a location where the OS will try to treat it is a script or config file) and ensure that the upload is secure against path traversal and other shenanigans, there's no real risk of you executing the file and having your server compromised.
The only other thing you should try to be careful of is an attacker using your server to host the malware. This means being careful not to allow the uploaded temporary files to be accessible via the web server, and not to allow unauthenticated access to files on the S3 bucket if you're using one.
You should also ensure that temporary files are deleted if the upload is aborted or some other failure occurs during the upload. Otherwise an attacker can start uploading a 1MB file, claim that it is 8MB, then terminate the upload after the file contents are uploaded. Since the upload didn't complete, this will likely skip your "scan with ClamAV after upload" trigger, and leave the file on disk in the temporary directory. Proper error handling can prevent this.