Phenotypic effects of mutations are highly dependent on the genetic backgrounds in which they occur, due to epistatic effects. To test how easily the loss of enzyme activity can be compensated for, we screen mutant libraries of BlaC, a β-lactamase from Mycobacterium tuberculosis, for fitness in the presence of carbenicillin and the inhibitor clavulanic acid. Using a semi-rational approach and deep sequencing, we prepare four double-site saturation libraries and determine the relative fitness effect for 1534/1540 (99.6%) of the unique library members at two temperatures. Each library comprises variants of a residue known to be relevant for clavulanic acid resistance as well as residue 105, which regulates access to the active site. Variants with greatly improved fitness were identified within each library, demonstrating that compensatory mutations for loss of activity can be readily found. In most cases, the fittest variants are a result of positive epistasis, indicating strong synergistic effects between the chosen residue pairs. Our study sheds light on a role of epistasis in the evolution of functional residues and underlines the highly adaptive potential of BlaC.© 2024. The Author(s).