Spend some time in the Old West town of Cody, Wyoming, and you begin to understand why Americans are so attached to their firearms.

I find myself standing in an indoor shooting range, earmuffs in place, plastic safety glasses covering my eyes and a muzzle-loaded .50 Kentucky Flintlock musket pressing into my shoulder. Energy zings through my body as I line up the sights, hold my breath and pull the trigger. Black powder ignites with a bright orange flame, filling the air with the smell of gun­powder smell. Smoke spews forth. Bullseye.

Donations to NRA surge, despite rise in anti-gun protests

“Some people pull the trigger, scream, then drop the gun,” says Scott McEndree, instructor at the Cody Firearms Experience. That’s why he puts just one bullet in a gun the first time a visitor shoots. As he loads six rounds into my next weapon, a Colt 1873 single-action army revolver, I realise I’ve passed the not screaming test.

Wyoming is far, both geographically and politically, from cultural centres such as New York and Los Angeles. The popula­tion of the western state’s biggest city is less than 60,000. Self-sufficient people who prize the Second Amendment (which protects of the right to bear arms), big skies and a lot of space are drawn to the United States’ least populous state.

William F. Cody, better known as Buffalo Bill, was born in 1846. He delivered mail for the Pony Express, served as an army scout and earned his nickname by shooting dead more than 4,000 buffalo, to feed the men building the Kansas Pacific Railroad.

By the early 1870s, Buffalo Bill was a national folk hero. He took to the stage, playing himself in what would evolve into Buffalo Bill’s Wild West, a circus-like extravaganza dramatising Indian attacks, buffalo hunting and other aspects of Western life. By the time he founded the settlement of Cody, in 1895, Buffalo Bill was world famous.

Visitors often start their exploration of Cody with a tour aboard a “trolley” (an unusual looking bus). Guides welcome them aboard by playing an audio clip of Buffalo Bill himself, announcing his Wild West show, recorded by Thomas Edison.

In an hour, passengers learn about Wyoming’s firsts: first national park (the nearby Yellowstone); first state to give women the vote, in 1869; first female governor – Nellie Tayloe Ross took office in 1925.

A less fortunate Wyoming woman was Cattle Kate, a suspected horse rustler who was lynched in 1889. The guides point out the rodeo grounds and Old Trail Town, a collection of 20 or so homesteader cabins and other Western-style buildings, before the trolley continues through the chilly tunnels bored through Rattlesnake Mountain and the ridge to Cody’s west, and cruises by the town’s last brothel, now a day-care centre for children.

Known for its cherrywood bar – a gift from Britain’s Queen Victoria – enormous porch and rooms in which Annie Oakley and Calamity Jane once slept, the Irma hotel was built by Buffalo Bill in 1902 and named for one of his daughters. The trolley returns to the hotel just in time to witness a gunfight.

In the dusty street outside the Irma, sheriff Wyatt Earp is having a showdown with Butch Cassidy and the Sundance Kid. The show is on the silly side of the Old West spectrum, but proves popular.

The Buffalo Bill Center of the West is Cody’s most visited museum. This Smithsonian affiliate is a world-class collection of, more accurately, five museums, dedicated to Buffalo Bill (he was a lousy husband), Plains Indians (their bead work was some­thing else), Western art, natural history and – surprise, surprise – firearms.

“If you’ve seen one Glock, you’ve seen them all,” says a visitor in the Cody Firearms Museum, as he passes the polymer pistols in favour of ornately carved rifle locks in the Embellished Arms Gallery.

The centre’s Dan Miller’s Cowboy Revue is really more of a cowgirl review, the trio of Miller, his daughter Hannah and singer/bass player Wendy Corr belting out classics such as Home on the Range, El Paso and They Call the Wind Mariah.

From 1942, more than 110,000 people of Japanese descent living in the western US were shipped off to 10 detention centres for the duration of the second world war. One of those centres was Heart Mountain, 24km to the northeast of Cody.

On what is now a quiet expanse shaped like a buffalo heart that lies in front of the mountain, 467 tarpaper barracks once stood, home to 14,025 internees, mainly from Californian cities. Most lost their homes and businesses. The 566 babies born in the camp, a sign informs visitors, “came into the world as American citizens behind a barbed wire fence, erected by their own government”.

The exhibits at Heart Mountain Interpre­tive Centre show how internees endured dust storms, extreme cold and rattlesnakes, and maintained some kind of normality by establishing schools, sports teams andorigami competitions. Whatever a visitor’s ethnicity, Heart Mountain stirs the kind of emotions that are again being whipped up by the Trump regime’s approach to immigrants. Boxes of Kleenex are strategically placed.

Japanese-Americans complied with the US government during the war. “What were we going to do, rise up and fight?” one former internee asks in All We Could Carry, a documentary shown at the centre. But most Wyoming natives – accustomed to the sparsely populated, every-man-for-himself state – have done exactly that since frontier days.

That’s why McEndree, at the Cody Firearms Experience, compared the Ruger tucked down the back of his jeans to a seat belt. “You don’t plan on having an accident …” he said.

On my last night in Wyoming, I visit the Cody Dug Up Gun Museum, the collection of one Hans Kurth. Whether found in dusty attics or located underground by metal detectors, these weapons are presented in their natural state of decay – rusty, parts missing, bullets jammed forever in chambers. Kurth explains that each gun tells a story; a first world war revolver looks as though it was shot out of a soldier’s hand, and was probably the last thing he ever touched.

In the Old West, Kurth says, guns weren’t optional, everybody was expected to carry. “Even preachers,” he says.

Exploring the Chinese Exclusion Act, a racist stain on the American dream

Everybody except the Chinese, that is. Among the collection is a brassy, flat, almost two-dimensionally primitive gun a worker made in Chinese Camp, California, during the 1856 Tong War, when Chinese were prohibited from owning firearms.

The Dug Up Gun Museum reflects America’s complicated fascination with guns. The essence of gun ownership sits deep in the reptilian brain: survival. And the gun is intricately entwined with aspects people love about the Old West: freedom and possibility; self-sufficiency; physical strength and prowess; open spaces; untamed beauty; and lives that unfold far from civilisation, law and order.

Cody represents America’s more rugged face, lock, stock and many smoking barrels.

Getting there

United Airlines flies between Hong Kong and Cody via San Francisco and Denver