What is the best method to learn all chords AND their inversions in all keys ?
Example key C: CM7 Dm7 Em7 FM7 Gdom7 Am7 Bdim7
Learn to play and practise arpeggios. Start with roots, then when you're good play first inversions, a couple or three octaves should do. Get to know which notes actually make up a chord - CM7 = C,E,G,B; Fm7 = F Ab C Eb, etc. Do them hands together and singly. Then split chords between hands and play as block chords as well.
I've never "learned all chords in all keys"*, but I could still tell you what they are. Just like I've never "learned what six added to every number is", but I could still add six to any number.
*BTW, you could say diatonic chords in a key if you wanted to make it clear that you're only talking about chords including notes from the key.
You haven't mentioned your instrument; if it's guitar there is a solution. Learn chord forms that do NOT utilize any open strings. These forms are readily transposed on guitar to any key. You will find that these movable forms are typically related to certain fixed chord forms, such as the E, A, D, C, and even the G. After you master the movable forms from 7s (and 6s) through 13s, then address the fixed forms.