Ffuser1 in most cases, the plugins under WordPress for image compression typically have limitations around the file size and for anything other, you need a paid plan.
There are a number of free image compressors and webp convertors on the internet - I use several myself, although none have a free API to send images through and return a new compressed image. There's also the privacy aspect to consider. Most images (unless stripped) will contain EXIF data that can provide attribution. Some image compressors will also tag their own EXIF data as a way of identifying the commission service that handled or converted the image.
To my knowledge, the only web platform that performs it's own image compression and conversion into webp is Litespeed but that's not free either.
Edit - seems reSmush is still free and could easily be used inside an extension. The real issue is calling the image back, changing the extension, and also the image name of what's already been uploaded. To this end, the extension would need a fair amount of logic in order to process, and would also need a way of bulk processing images in the background so that the front end is not locked.
This API also removes the EXIF data by default.