Does the Bible completely forbid lying? No, it does not. In Exodus, we find that Pharaoh ordered the killing of all new-born baby boys. He ordered the midwives to carry out such a heinous crime:
15 The king of Egypt said to the Hebrew midwives, whose names were Shiphrah and Puah,
16 “When you are helping the Hebrew women during childbirth on the delivery stool, if you see that the baby is a boy, kill him; but if it is a girl, let her live.”
17 The midwives, however, feared God and did not do what the king of Egypt had told them to do; they let the boys live.
18 Then the king of Egypt summoned the midwives and asked them, “Why have you done this? Why have you let the boys live?”
19 The midwives answered Pharaoh, “Hebrew women are not like Egyptian women; they are vigorous and give birth before the midwives arrive.”
20 So God was kind to the midwives and the people increased and became even more numerous.
21 And because the midwives feared God, he gave them families of their own. Exodus 1:15-22
In the above, Pharaoh asks Shiphrah and Puah why they did not carry out his order. And they responded by lying, telling Pharaoh that Hebrew women and Egyptian women are not the same, and that Hebrew women are vigorous and give birth in haste before they arrived (v. 19). In verse 20-21, instead of God rebuking Shiphrah and Puah for lying, YHWH rewards them by having ‘families of their own’. The silence of YHWH for not condemning the two midwives for deceiving Pharaoh shows that lying in certain situations in order to save innocent lives from being killed is allowed.
Making Sense of Bible Difficulties: Clear and Concise Answers from Genesis To Revelation – Norman L. Geisler And Thomas Howe:
Solution: There is little question that the midwives disobeyed Pharaoh by not murdering the newborn male children and lied to Pharaoh when they said they arrived too late to carry out his orders. Nonetheless, there is moral justification for what they did.
First, the moral dilemma in which the midwives found themselves was unavoidable. Either they obeyed God’s higher law, or they obeyed lesser obligation of submitting to Pharaoh. Rather than commit deliberate infanticide against the children of their own people, the midwives chose to disobey Pharaoh’s orders.
God commands us not to murder (Exodus. 20:13). The saving of innocent lives is a higher obligation than obedience to government. When the government commands us to murder innocent victims, we should not obey. God did not hold the midwives responsible-nor does He hold us responsible-for not following a lower obligation in order to obey a higher law (cf. Acts 4; Rev. 13). In the case of the midwives, the higher law was to the preservation of the lives of the newborn male children.
Second, the text clearly states that God blessed them ‘because the midwives feared God’ (Exod. 1:21). It was their fear of God that led them to do what was necessary to save these innocent lives. Thus, their false statement to Pharaoh was an essential part of their effort to save lives.
Third, their lying is comparable to their having disobeyed Pharaoh in order to save the lives of the innocent newborns. This is a case where the midwives had to choose between lying and being compelled to murder innocent babies. Here again the midwives chose to obey the higher moral law.
Obedience to parents is part of the moral law (Cf. Eph. 6:1). But if a parent commanded his or child to kill a neighbour or worship an idol, the child should refuse. Jesus emphasized the need to follow higher moral law when He said, ‘He who loves father or mother more than Me is not worthy of Me (Matt. 10:37). 
Notes on Exodus – Dr. Thomas L. Constable
The midwives’ fear of God (vv. 17, 21) led them to disobey Pharaoh’s command to practice genocide. They chose to obey God rather than man since Pharaoh’s order contradicted a fundamental divine command (cf. Gen. 1:28; 9:1, 7). All life belongs to God, so He is the only person who has the right to take it or to command when others should take it. The midwives’ fear of God resulted in their having reverence for human life. Their explanation of their actions (v. 19) may have been truthful or it may not have been entirely truthful.
“Even though these women lied to Pharaoh (which the Bible, as is often the case, does not stop to specifically condemn at this point), they are praised for their outright refusal to take infant lives.”33 God blessed these women with families of their own (v. 21) in spite of their deceit, if they practiced it, because they feared God. 
The NIV Application Commentary: 1 & 2 Samuel – Bill T. Arnold:
Take, for example, Shiphrah and Puah, the Hebrew midwives of Exodus 1:15-21. The Egyptian pharaoh tried to control Israelite population growth by demanding that the midwives in charge of Hebrew births kill the boys, allowing only the girls to live.
But because the midwives were God-fearing women, they refused to obey the King and allowed the boys to live as well. When Pharaoh demanded to know why they did not obey him, they simply lied (1:19): ‘Hebrew women are not like Egyptian women; they are vigorous and give birth before the midwives arrive’. In this case, the midwives were blessed for their actions.
God rewarded them with families of their own because they feared him more than the Egyptian king and chose to risk lying rather than kill the newborn Hebrew boys. Likewise Rahab certainly told a lie to the king of Jericho to save the two Israelite spies (Josh. 2:4-6), and New Testament authors unanimously praise her actions as works of faith (Heb. 11:31; James 2:25).
When we compare these disparate episodes, a certain biblical ethic begins to emerge, which is supported by our text in 1 Samuel 19. Rather than a monlothic prohibition against all lying and deception, the Bible offers general principle, modified with several exceptions. The general principle is most notably stated in the ninth commandment, which contains a statement against lying in a court of law (Ex. 20:16). Elsewhere the Bible generally disdains all falsehood (Prov. 11:3) and portrays Satan as the ‘father of lies’ (John 8:44; Eph. 4:25).
But then we have exceptions such as the Hebrew midwives, who chose to embrace the guilt of deception in order to preserve the lives of the newborns. They unselfishly put themselves at risk before the Pharaoh rather than fulfil his gruesome orders.
Jonathan and Michal seem to be in the same category as the Hebrew midwives and Rahab. These biblical characters choose the higher good and are willing to accept the consequences of their choices, even if it puts them at personal risk in order to help innocent person.
Many Christian scholars through the centuries have agreed. Thomas Aquinas distinguished three classes of lies: Officious lies, or helpful lies of necessity; jocose lies, told in jest; and mischievous lies, or malicious lies told to harm another person or to save face personally. Only the third category constitutes sin in Aquinas’s view.
I would agree with Aquinas, but I would also warn that the lie of necessity is only morally justified (even morally required?) under certain circumstances, such as rare situations where it is clear that innocent lives are at stake. In this biblical ethic, lying and deception are wrong and to be avoided. However, the actions of Jonathan and Michal, the Hebrew midwives, and others suggest there are times when believers should choose to accept the guilt of lying in order to accomplish a higher good, as they believe it to be defined by God. Thus, we recognize deception as always bad but sometimes desirable in extenuating circumstances. 
 Making Sense of Bible Difficulties: Clear and Concise Answers from Genesis To Revelation By Norman L. Geisler And Thomas Howe page 45 – 46
 Notes on Exodus [2014 Edition] By Dr. Thomas L. Constable page 14
 The NIV Application Commentary: 1 & 2 Samuel [Zondervan] by Bill T. Arnold, page 410