Does the buffer have other functions than to increase the signal
strength? Maybe a transformation from high impedance to low impedance?
It's usually a good idea to convert a high impedance to a low impedance when sending an analogue signal down a cable to a receiver amplifier. It usually cuts down on noise influencing the signal and reduces the differential noise error that would be received by the InAmp.
Is the low impedance after the buffer important to avoid noise
through external magnetic fields?
The important thing here is that the impedance presented by the driver output is matched by the ground connection to the other wire in the twisted pair. In other words, the driven end of the cable is impedance matched in both wires prior to connecting to the cable.
This ensures that external magnetic and electric noise/interference fields that might "hit" the cable will produce identical voltages on both wires in the twisted pair. If the EMI voltages are the same on both wires then the InAmp (or differential amplifier or balanced receiver) can subtract them to zero.
Would it be wrong to have a long distance between the sensor and the
buffer, because the impedance between senor and buffer is high?
It's not ideal.
I have read impedance matching is important. But the output of the
buffer is low and the input of the in-amp is high. Is it ok?
Impedance matching can mean several things. In this scenario, you might need cable termination impedance matching (for high speed signals) but, you will also need balanced driver matching at the transmitter (as described above) and a balanced impedance at the receiver.
Regards the transmit end, it might be a good idea to put series resistors in the feed leads like this: -

The reason should now be clear; the output from the driver may be a few ohms whereas the other wire in the twisted pair is "hard" connected local ground. This is not ideal and the two resistors shown as "R" will "balance" driving impedances and reduce the impact of noise due to equalization.
Balancing the driver and receiver is all about making sure that whatever noise influences the wires in the twisted pair, it influences both wires identically. The InAmp will do the rest.
See also this Q and A, particularly my answer.
