You can use the ComponentRegistrar
by injecting ComponentRegistrarInterface
and get a module's directory like this:
$path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Your_Module');
Since all modules are required to register their directory with this class in their registerregistration.php
file, it doesn't seem like something magento would change.