Microbial stress response and adaptation to nutrient and energy scarcity on Earth and beyond