Bored Hatamoto (1930)
Bored Hatamoto: The Imposter

Overview
Around the Genroku era, there was a man named Saotome Shusui-no-Suke, nephew to the senior councilor Matsudaira Sakon Shogen. He was commonly known as the Bored Samurai of the Hatamoto rank. Just as he was engulfed in boredom, Tokugawa Jo-Kaibo, claiming to be the Shogun's illegitimate child, made a grand entrance into Edo. At the behest of Sakon Shogen, Shusui-no-Suke was tasked to investigate Jo-Kaibo's background and had his young page Kyoya disguise as a woman to infiltrate Jo-Kaibo's gun mansion.
Similar
Seven Samurai (1954)
Kubi (2023)
Zatoichi (2003)
Sasaki Kojiro (1957)
Case of the Hidden Coin (1959)
Bloody Battle at Dawn (1959)
Assassins for sale (1963)
Shadow Hunters (1992)
Ask This of Rikyu (2013)
The Fox Dancing in the Dusk (2019)
Lowly Ronin 5: The Teenage Orphan Girl (1983)
Iemitsu, Hikoza and Isshin Tasuke - A National Crisis: Edo Castle in Danger (1989)
Two Portraits of MIYAGINO (2010)
Sanada 10 Braves (2016)
Samurai Fiction (1998)
Shinobi: Heart Under Blade (2005)
The Last Samurai (2003)
The Hidden Fortress (1958)
Date Masamune the One-Eyed Dragon (1942)
The Yagyu Conspiracy (2008)