I highly recommend using a whole ham bone instead of ham slices or pieces. There is quite a difference in taste. You can buy these from a ham store like Heavenly Ham.
Saute chopped onion in butter until tender but not browned. Add beans, water, bouillon cube, ham bone, bay leaves, thyme, oregano, salt and the New Mexico peppers.
Bring to a boil, reduce heat, cover and simmer for one hour. Remove bay leaves, ham bone, and the New Mexico pepper. Dice ham. Chop green bell pepper.
Using a blending stick hand blender, blend the ingredients in the soup for just a bit. If you don't have a stick blender, take out a cup of beans and mash them, and return to pot. This helps to thicken the soup. Add diced ham, green pepper and simmer another 15 minutes or more.
I serve this as soup, but you can serve the beans over rice if you like. Top with a dollop of sour cream.