How do I disable Twig and block cache for a specific module?
You can control the cache in the render array with the #cache element.

To disable the cache add:

$build['#cache']['max-age'] = 0;


In this case the block will not be cached for logged in users or anonymous users with a session.

If you want to disable the cache for anonymous users without a session:


  Disable it either by uninstalling the page_cache module completely or
  by triggering the kill switch, see
  How can I prevent a particular page being cached? for example.


The caching of the twig code is not connected to this, the twig code is only cached once, the first time it is used after you cleared the cache.

(edit acc. to comments of Berdir)