Moldy bread? Nah.
Moldy hard cheese? Just generously cut off the mold and it's fine*
*I wouldn't feed this to anyone else, but I'd eat it, and do all the time
EDIT: the USDA agrees that moldy hard cheese is safe to eat https://ask.usda.gov/s/article/If-food-has-mold-is-it-safe-to-eat
For hard cheese, such as Cheddar, cut off at least 1-inch around and below the mold spot (keep the knife out of the mold itself). After trimming off the mold, the remaining cheese should be safe to eat.
