I know this is simple, but I don't fully understand why the motion of a piston is considered to be simple harmonic? Wouldn't the piston and connecting rod have mass?
Simple harmonic motion is for small vibrations in an isolated system(free from damping forces). If you have a pendulum of mass 20g it can also undergo shm. Mass just affects it's time period. A piston can also undergo shm.