The Qur'an instructs Muslim women and men to dress modestly, and for some, the hijab is worn by Muslim girls and women to maintain modesty and privacy from unrelated males. According to the Encyclopedia of Islam and Muslim World, modesty concerns both men's and women's "gaze, gait, garments, and genitalia".
Surah Al-Ahzab, verse 53
The term for head covering in the Qur'an is known as 'Khimar'. The khimar originates from the trilateral verb `khamara', which means `ghatta' meaning to conceal, hide, or to cover something. “Let them wear their Khimar over their juyub” which is their chest.
"The head covering is mandated in the Quran, so it is necessary. In Surah al-Ahzab, Sur-e-Noor mandates covering the head, so it is an essential part of Islam."
Mufti Menk on Twitter: "Hijab is a right today, tomorrow and everyday. The right to cover. #WorldHijabDay #StrongInHijab" / Twitter.
There is no prescribed punishment for not wearing Hijab mentioned in Shariah, but yes, a Ta'zir punishment can be given by the ruler if he wants.
Iranian law states that "anyone who explicitly violates any religious taboo in public" should be imprisoned for up to two months, or flogged with 74 lashes. In practice, this means women must cover their hair with a headscarf and their arms and legs with loose clothing.
Definitely, modesty without Hijab is possible. Consider the famous Malala Yousafzai, a Pakistani activist for female education and the youngest Nobel Prize laureate. She would have been the same even without wearing Hijab. It is the deeds that decide, how a person is!
"The Holy Quran does not mandate wearing of hijab or headgear for Muslim women. Whatever is stated in the above sūras, we say, is only directory , because of absence of prescription of penalty or penance for not wearing hijab, the linguistic structure of verses supports this view", the Court observed.
In modern usage, ḥijāb (hijab) generally refers to the customary Islamic female headcovering. Wearing hijab is mandatory in certain Islamic countries, and optional or restricted in other majority Muslim and majority non-Muslim countries.
The Karnataka High Court upheld the ban on hijab by the educational institutes on 15 March 2022. The court ruled that hijab is not an essential religious practice under Islam and, hence, is not protected by the Article 25 of the Constitution setting out the fundamental right to practice one's religion.
The short answer is nothing would happen. Nothing would change except for the fact that you had taken off your hijab and now people can see your hair.