There really isn't a maximum!
You have already hit the major concerns including using the same state of charge, using batteries that are in the same condition, from the same manufacturer (and preferably the same lot number to get an even closer match). You also want to make sure that you never short circuit that battery pack as it will have an incredible amount of power and can release that power really quickly. Putting the cells in parallel also lowers the internal resistance.
Where did you read that 3 is the maximum for parallel for regular lithium ion? I built a battery pack from 40 - 18650 lithium ion cells in parallel and use it every day. I connected a PCB to protect against short circuit, over charge and over discharge.
It is used for relatively low current, 4 amps and less, but charges at as fast as 10 amps with no problems.
For your project I would look at the electric bicycle group. They probably have the most experience using larger LiFePo4 batteries. I am sure that they have added them in parallel and can share their experience. I agree with you that the LiFePo4 is a relatively safe chemistry. Another alternative is the lithium Manganese battery chemistry found in the Nissan Leaf. There are videos on YouTube showing people hammering nails through the battery with no fires or explosions. The Leaf's battery runs at the usual lithium voltage of 3.0 - 4.2, unlike the LiFePo4 which runs at a lower voltage.
I imagine from the questions that you have asked that you are planning some project that may require a high capacity lithium iron phosphate battery that you would like to build yourself.
The only large capacity battery pack in high numbers production that uses a number of cells in parallel vs only a couple of large cells in parallel is the Tesla. All of the other EV seem to go with the large capacity pouch cells and then only use a couple in parallel. The advantage to the Tesla is that their power to weight ratio is almost double that of everyone else.
The disadvantage has to be safety. Tesla has 104 patents on its battery pack and most of them have to do with safety. Specifically with how to deal with single cells that short or go into thermal runaway. FYI the Tesla S battery pack uses 74 cells in parallel and then 96 in series.
I have read through their patents and none of them deal with any sort of system to repair or remove damaged individual cells. They just make sure that on the rare occasion that a cell does short or heat up, start fire etc., that it is contained to that cell. They do this by separating each cell by a certain distance, using active and passive cooling, using a fuse at each cell etc.
Tesla brags that they can replace an entire battery pack out of a Tesla S in only 90 seconds, but they make no claims about repairing that battery pack. In fact because of all of the safety features like fire proof foam, it takes a couple of hours for a person to get access to the individual cells of the Tesla battery pack and by that time you have ruined the structure of the battery, so it is no longer useable to the car even if you did replace the destroyed individual cell.
So to answer your question, it appears that they put a lot of effort into preventing a shorted cell from destroying the rest of the pack, but otherwise they leave it there and let the rest of the cells in that parallel group take over.
Remember that the Tesla is demanding a very heavy load from its battery, not only pushing the cells to their limits to get a further distance out of the pack (some owners report cell voltages that dip below 3.0 volts) they also demand a high current for the crazy acceleration the Tesla gets.
From reading their patents, Tesla believes that over charging is much more dangerous than over discharging (this is from tests they have done in their labs). Over charging leads to fires and explosions while over discharging tends to speed up capacity loss.
Good luck in your project. Using lithium iron phosphate cells you are already a magnitude safer.
Best Answer
It will be almost impossible to match internal resistance since this is defined by the state of charge, temperature etc.
The best way to match the cells is to fully charge to the same endpoint voltage and then discharge each cell with the same load current (a simple load resistor) to a fixed endpoint voltage measured with a decent multimeter. This will give you the approximate capacity of each individual cell.
Select 4 cells with the closest capacity (ie time to your discharge endpoint can be used).
The internal resistance of all four cells you select is effectively in series for discharging, so the impact on the terminal voltage of the 4S under load is impacted by all the internal resistance.
If you match the capacities of the batteries closely, you may not need a BMS. However a BMS is always better.
This may help your understanding of the subject.