Best way to delete all variables when uninstalling module
Variables are cached, so deleting manually is fine so long as you invalidate that cache, e.g.

db_delete('variable')
  -&gt;condition('name', 'mymodule_%', 'LIKE')
  -&gt;execute();

cache_clear_all('variables', 'cache_bootstrap');