You are not the first person I have heard of who uses large quantities of camera. Some have bought the SR300 in bulk quantities such as 10, 30 and even 100. I think the largest number used on the same machine that I heard of though was four. Typically, multiple cameras are used on a number of different PCs rather than connecting them all to one machine.
With the official RealSense SDK, I believe that you can connect multiple SR300s to one machine but only one camera at a time can be the one that is actively sensing, and you need to change to a different camera ID to make a particular camera the active one. The open-source Librealsense SDK can process multiple camera streams but it does not have all the features that the official SDK has (and vice versa - Librealsense has some features the official SDK lacks).
I guess you could set the system up to cycle through the 40 cameras in quick succession, each one taking a snapshot and then passing control to the next camera in the sequence until it has cycled through all 40 cameras and looped back to camera 1 again to start the sequence anew.
I'm also experimenting with multi-camera setups, using the Joule. The most I have gotten working at once with the Joule is 3 cameras (using librealsense under Ubuntu), but this is probably mostly due to the fact I can only use one USB 3.0 root port. If you can distribute the cameras around more than one root port, you may be able to get more running at once. I should note too that to get three working I had to lower the frame rate to 30 Hz.
As for merging the samples, the best thing to do I think would be to merge the point clouds using something like PCL (Point Cloud Library). I'm experimenting with RGBD-slam which also estimates the position of the camera by matching against previously captured points.
Some of the older cameras do have a tendency to interfere with one another though when their fields of view overlap. Seems to be less of a problem with the newer cameras. Cycling through multiple cameras (there are controls to turn the projectors on and off) can help with that, too. However, there is a minimum startup time so don't expect to get a very high frame rate doing this.
We use multiple cameras in our applications. We use these to image wood for defect/shape processing. What you are asking is technically possible over a network node configuration.
Send me a message if you would like to discuss in detail what your application. Maybe we can offer some suggestions.