(You do know that ^ means XOR, not exponent, right?)
Although I actually do know I didn't realize, I definitely switch between languages too often. That's my error, please excuse. The good news is that just the calculation of the set speed is wrong, the speed itself is correct.
The correct calculation would be:
#include <math.h>
uint32_t i2c_prescaler = pow(4, TWSR & 0x03);
uint32_t i2c_freq = 16000000L / (16 + 2 * TWBR * i2c_prescaler);