Use drush to save a list of all enabled non-core modules to a text file, then disable/re-enable all modules on that list
#
drush pml --no-core --type=module --status=enabled --pipe > modules.txt
cat modules.txt | xargs drush -y dis
cat modules.txt | xargs drush -y en