One of the most vital things to know in understanding the characrter of God is His two step process of saving the sinner. Romans 5:20 tells us that God causes His law to enter into the private thoughts of man and this causes his sinfulness to actually increase. When it is obvious to the sinner that he is sinful and He repents then grace can be received.
The commands of God for his people to slay other nations are part of the first step in the two step process. In order for men to see their murderous natures, God reflects back to them their sinful thoughts that they might repent. How do we know when God is actually speaking to us and when He is reflecting our sins back to us for repentance? Through the life of Jesus on earth. When God speaks like Jesus then we know it is His character. When God does not speak like Jesus, it shows He is reflecting human sinfulness.
This is a vital principle to understand in the two covenant process. First there is the death of self in the revelation of sinfulness. Then there is the newness of life in the grace given by God. When you understand this principle then the Bible will open up the beauty of God's loving character in a new and living way.