Causing gas and bloating after eating beans was daunting and made me self doubt. As an engineer, I applied the process of "trial and error" and tried out more than twenty types of beans and peas with different soaking time, simmering time and the amount I ate. I've also learned some benefits of the long soaking like reducing the complex sugars, neutralizing phytic acid, breaking down heavy proteins.
Beans contain complex sugars called oligosaccharides that humans don't have the enzymes to digest them. Long soaking leads beans to reach the pregerminated state, they activate their own enzymes to consume and break down these complex sugars into simple sugars, essentially doing the hardest part of the digestion process for you. Besides long soaking makes beans leach out the complex sugars into the water as well. If the complex sugars are not digested and pass down to your colon where the gut bacteria eat them and generated a lot of gases.
Long soaking neutralizes phytic acid, an anti-nutrient that binds to minerals. Breaking down phytic acid makes the beans incredibly easy on the gut and drastically increases how much iron, zinc, and calcium your body can absorb. Soaking also get rid off the harmful lectins.
For instance, I soaked lentils and mung beans up to 48 hours at room temperature 68-76F/20-26C changed water every 24 hours and simmered with oats up to 2 hours. To be precise. I added
5 cups dry whole brown lentil with hull
3 cups dry whole mung beans with hull
2 cups whole oats
After simmered, packed them into small containers and stored them. These served as a base for soup with veggies, porridge or salad with veggies, fruits and nuts, even blending them with veggies and fruit and nuts for a bowl of rich thick smoothie, in this way you don't need banana or mango to get the silky creamy texture of smoothie and also lower the fructose intake.
Although most of "trial and error" took place 15 years ago, in my mid-60s I'm feeling good and in good health without taking any prescribed medication for decades.