There are external GPU cases that might work with your laptop, but at least on older models these were relatively bandwidth limited which doesn’t matter that much for gaming, but I guess it might cause more problems with AI workloads? On the other hand, maybe not if the model fits completely into the vRAM of the m40?
If you connect via 10gbit PCIe extension cards it is often a question of how many PCIe channels the CPU has and if the mainboard you are using has these connected directly to the CPU or needs to pass them through the mainboard chipset which is much slower.