What legal accountability, if any, was available regarding the atomic
bombing of Hiroshima and Nagasaki around that time?
None.
Who could request an investigation into the incident? Could people who
weren't US citizens request that the US government or other body
investigate the incident? Would those investigating the incident be
free to investigate it without being forbidden by their superiors? . .
. And what about those following orders given directly or indirectly
by the POTUS?
This was a very well documented incident whose details were not hidden from the public for very long. The U.S. itself publicized the details out of sentiments that first were basically civic pride, and later were out of a desire for historical accuracy of a historically important event. Thus, it was "investigated".
But, it was also entirely legal at the time. This was not a war crime as defined by any international law binding on the United States, or domestic law of the United States during World War II.
There was a declared war between the United States and Japan and that justified the use of any level of military force deemed appropriate by the U.S. against Japan under the law of that time period, even if many innocent civilians were killed as collateral damage.
The treaties that made it a war crime to use nuclear bombs on civilians, and other arguably applicable modern treaties governing the conduct of war that are designed to protect innocent civilians, did not exist during World War II.
For example, the Fourth Geneva Convention, which provides protection to civilians in times of war, was not adopted until 1949.
The Hague Conventions (II) and (IV) of 1899, which were restated in the Hague Conventions (IV) of 1907 with the same article numbers for the most part Hague Convention of 1899 (II), arguably applied (in particular, parts of Annex Articles 22 to 28), but had no enforcement mechanism and didn't adopt a stance of personal liability of governmental leaders for war crimes.
Basically, the Hague Conventions contemplated a regime in which one sovereign would sue another sovereign for alleged war crimes in an international court of arbitration, or would retaliate against violators militarily, rather than one in which individuals would have standing to enforce violations of these treaties. But, the court of arbitration was never established or used in any case of consequence.
The relevant articles (omitting irrelevant articles and irrelevant subparagraphs of articles quoted below) stated that:
Art. 22.
The right of belligerents to adopt means of injuring the enemy is not
unlimited.
Art. 23.
In addition to the prohibitions provided by special Conventions, it is
especially forbidden -
To employ poison or poisoned weapons;
To kill or wound treacherously individuals belonging to the hostile
nation or army;
To declare that no quarter will be given;
To employ arms, projectiles, or material calculated to cause
unnecessary suffering;
To destroy or seize the enemy's property, unless such destruction or
seizure be imperatively demanded by the necessities of war;
Art. 25.
The attack or bombardment, by whatever means, of towns, villages,
dwellings, or buildings which are undefended is prohibited.
Art. 26.
The officer in command of an attacking force must, before commencing a
bombardment, except in cases of assault, do all in his power to warn
the authorities.
Art. 27.
In sieges and bombardments all necessary steps must be taken to spare,
as far as possible, buildings dedicated to religion, art, science, or
charitable purposes, historic monuments, hospitals, and places where
the sick and wounded are collected, provided they are not being used
at the time for military purposes.
It is the duty of the besieged to indicate the presence of such
buildings or places by distinctive and visible signs, which shall be
notified to the enemy beforehand.
Art. 28.
The pillage of a town or place, even when taken by assault, is
prohibited.
As indicated with emphasis above, even many of these provisions arguably had limitations that would prevent them from applying by their own terms.
Realistically, the emphasized weasel words above, as understood at the time, would have relieved the U.S. of liability under all of the applicable Articles, even if there was any means for legally enforcing the Hague Convention (IV) of 1907 which superseded the Hague Convention (II) of 1899.
The United States was never a party to Hague Convention of 1899 (IV), which expired in 1904 anyway and banned aerial bombing from balloons and analogous devices. The U.S. was a party to parallel provisions of the Hague Convention of 1907, but Japan was not a party to those. And, the Hague Conventions only applied when all states involved in a conflict were signatories of the treaty in question.
The legal effect of the Hague Conventions had also been severely degraded by WWII, due to the fact that they were widely disregarded with impunity in World War I.
Also, any remedy of Japan as a sovereign nation, or of individuals in Japan harmed by the bombings, against the United States or any of its leaders, would have probably been waived by the terms of the treaty of surrender that ended the war in the Pacific in 1945.
And, any remedy of Japan as a sovereign nation would have been setoff for alleged warcrimes of Japan against the United States, for example, for Pearl Harbor and violations of maritime provisions of the Hague Convention of 1907 adopted by both nations.
Furthermore, one of the recognized remedies for a violation of a law of war is a proportional violation of a law of war in retaliation by another combatant who is also otherwise bound by that law of war (not necessarily the combatant who was the victim of the original war crime). So, to the extent that Japan was guilty of serious war crimes itself, the law of war would have recognized the atomic bombing of two medium sized Japanese cities by the United States as a legal tit for tat retaliation for Japan's violations.
Furthermore, it is important to note an usual feature of the way that United States law treats treaties. In most countries, a domestic law cannot override a treaty with another country. But, under the United States Constitution, a domestic law passed after a treaty overrides a treaty where the two conflict, and a treaty passed after a domestic law overrides a domestic law when the two conflict. Thus, under U.S. law, the declaration of war on Japan in World War II would have prevailed legally over any conflicting provision of the Hague Convention of 1907.
Would the POTUS be immune from prosecution unless he were impeached by
congress?
The President has absolute immunity from civil and criminal liability for his official conduct under United States law (and under the law of many other countries which afford immunity to heads of state generally for their official conduct), and dropping these bombs would absolutely constitute official conduct.
If the President is impeached by Congress the only legal effect of that impeachment is that the President ceases to be President. It does not strip the President of legal immunity for conduct while the President was the President.