Buffer amplifier and input impedance
What I do not understand is why we treat all the independent sources as shorts while calculating input impedance.

Hopefully, this answer will make the reason clearer.

Someone on this website said you can try finding input impedance without treating independent sources as shorts and get the same result as if you did.

They are correct.
When we refer to the input impedance of a circuit, we are (almost always) referring to the small signal input impedance. That is, the input impedance gives us the ratio between how much the current will change if we make a small change in input voltage or vice versa.
$$Z_{in} = \frac{\Delta V_{in}}{\Delta I_{in}}$$
or, using the terms of calculus
$$Z_{in} = \frac{dV_{in}}{dI_{in}}$$
If we are given a circuit, such as this:



simulate this circuit &ndash; Schematic created using CircuitLab
We can calculate the relationship between the input voltage and the input current as follows.
$$I_{in} = \frac{V_{in} - V_{internal}}{R_{in}}$$
or
$$V_{in} = V_{internal} + R_{in}I_{in}$$
Differentiation gives us
$$Z_{in} = \frac{dV_{in}}{dI_{in}} = \frac{dV_{internal}}{dI_{in}} + \frac{d(R_{in}I_{in})}{dI_{in}} = \frac{dV_{internal}}{dI_{in}} + R_{in}$$
But since \$V_{internal}\$ does not depend upon \$I_{in}\$,
$$ \frac{dV_{internal}}{dI_{in}} = 0$$
So
$$Z_{in} = R_{in}$$
Which is exactly the impedance we would get if we simply treated the voltage source \$V_{internal}\$ as a short circuit.
If you understand how this works with one internal resistance and one internal voltage source, then it shouldn't be difficult to see that the same principal applies when there are a network of internal resistances and voltage sources.
The results we get &quot;the long way&quot; is equivalent to simply treating the internal voltage sources as shorts. Since it is also generally quicker to just do the latter, in practice, that is what we generally do. We treat internal voltage sources as shorts when calculating input impedance.