I have found it does not work really well with Canon RF lenses yet, because all RF lenses have Exif.CanonCs.LensType=61182* and using a .exiv2 file with (for example) 61182=Canon RF 50mm F1.8 STM leads to all RF lenses being identified as Canon RF 50mm F1.8 STM!
(*there is a new Exif.CanonFi.RFLensType field, but I don’t know if/how it is used by exiv2/darktable, and also the (not new) Exif.Canon.LensModel which contains a Ascii name like RF 50mm F1.8 STM)
Using exiv2 0.27.5 with darktable 3.8, my Canon RF 50mm F1.8 STM lens is identified as the F1.2 version and my other lenses are correctly identified.
What I do is import my cr3 files in darktable, then add the .exiv2 file in my /home with [canon] 61182=Canon RF 50mm F1.8 STM, set a collection in darktable with lens=Canon RF 50mm F1.2 USM, refresh exif information for this collection only. The lens is then well defined. I then remove the .exiv2 file.
Not really ideal, but it works. I hope it can help someone else.